|
@@ -92,7 +92,7 @@ f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(
|
|
|
g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*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},setRotationFromQuaternion:function(a){console.warn("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion. Please update your code.");return this.makeRotationFromQuaternion(a)},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,k=e+e;a=c*g;var l=c*
|
|
g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*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},setRotationFromQuaternion:function(a){console.warn("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion. Please update your code.");return this.makeRotationFromQuaternion(a)},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,k=e+e;a=c*g;var l=c*
|
|
|
h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);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=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=
|
|
h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);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=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(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("DEPRECATED: Matrix4's .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],k=c[12],l=c[1],n=c[5],q=c[9],s=c[13],u=c[2],t=c[6],p=c[10],v=c[14],w=c[3],r=c[7],x=c[11],
|
|
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("DEPRECATED: Matrix4's .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],k=c[12],l=c[1],n=c[5],q=c[9],s=c[13],u=c[2],t=c[6],p=c[10],v=c[14],w=c[3],r=c[7],x=c[11],
|
|
|
-c=c[15],A=d[0],G=d[4],P=d[8],I=d[12],C=d[1],B=d[5],L=d[9],H=d[13],J=d[2],y=d[6],N=d[10],z=d[14],D=d[3],E=d[7],F=d[11],d=d[15];e[0]=f*A+g*C+h*J+k*D;e[4]=f*G+g*B+h*y+k*E;e[8]=f*P+g*L+h*N+k*F;e[12]=f*I+g*H+h*z+k*d;e[1]=l*A+n*C+q*J+s*D;e[5]=l*G+n*B+q*y+s*E;e[9]=l*P+n*L+q*N+s*F;e[13]=l*I+n*H+q*z+s*d;e[2]=u*A+t*C+p*J+v*D;e[6]=u*G+t*B+p*y+v*E;e[10]=u*P+t*L+p*N+v*F;e[14]=u*I+t*H+p*z+v*d;e[3]=w*A+r*C+x*J+c*D;e[7]=w*G+r*B+x*y+c*E;e[11]=w*P+r*L+x*N+c*F;e[15]=w*I+r*H+x*z+c*d;return this},multiplyToArray:function(a,
|
|
|
|
|
|
|
+c=c[15],A=d[0],F=d[4],P=d[8],I=d[12],z=d[1],B=d[5],L=d[9],H=d[13],J=d[2],y=d[6],N=d[10],E=d[14],C=d[3],D=d[7],G=d[11],d=d[15];e[0]=f*A+g*z+h*J+k*C;e[4]=f*F+g*B+h*y+k*D;e[8]=f*P+g*L+h*N+k*G;e[12]=f*I+g*H+h*E+k*d;e[1]=l*A+n*z+q*J+s*C;e[5]=l*F+n*B+q*y+s*D;e[9]=l*P+n*L+q*N+s*G;e[13]=l*I+n*H+q*E+s*d;e[2]=u*A+t*z+p*J+v*C;e[6]=u*F+t*B+p*y+v*D;e[10]=u*P+t*L+p*N+v*G;e[14]=u*I+t*H+p*E+v*d;e[3]=w*A+r*z+x*J+c*C;e[7]=w*F+r*B+x*y+c*D;e[11]=w*P+r*L+x*N+c*G;e[15]=w*I+r*H+x*E+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},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
|
|
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},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
|
|
|
return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
|
|
return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
|
|
|
a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},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],k=a[13],l=a[2],n=a[6],q=a[10],s=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*s-c*h*s)+a[7]*(+b*h*s-b*k*q+e*f*q-d*f*s+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*s-e*f*n+c*f*s+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*q+d*f*n-c*f*
|
|
a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},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],k=a[13],l=a[2],n=a[6],q=a[10],s=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*s-c*h*s)+a[7]*(+b*h*s-b*k*q+e*f*q-d*f*s+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*s-e*f*n+c*f*s+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*q+d*f*n-c*f*
|
|
@@ -143,11 +143,11 @@ THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:functio
|
|
|
c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(){var a=[];return function(b){if(void 0!==this._listeners){var c=this._listeners[b.type];if(void 0!==c){b.target=this;for(var d=c.length,e=0;e<d;e++)a[e]=c[e];for(e=0;e<d;e++)a[e].call(this,
|
|
c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(){var a=[];return function(b){if(void 0!==this._listeners){var c=this._listeners[b.type];if(void 0!==c){b.target=this;for(var d=c.length,e=0;e<d;e++)a[e]=c[e];for(e=0;e<d;e++)a[e].call(this,
|
|
|
b)}}}}()};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},g=new a.Vector3,h=new a.Vector3,k=new a.Vector3,l=function(f,n,u){if(f instanceof a.Sprite){d.setFromMatrixPosition(f.matrixWorld);var t=n.ray.distanceToPoint(d);if(t>f.scale.x)return u;u.push({distance:t,point:f.position,face:null,object:f})}else if(f instanceof
|
|
b)}}}}()};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},g=new a.Vector3,h=new a.Vector3,k=new a.Vector3,l=function(f,n,u){if(f instanceof a.Sprite){d.setFromMatrixPosition(f.matrixWorld);var t=n.ray.distanceToPoint(d);if(t>f.scale.x)return u;u.push({distance:t,point:f.position,face:null,object:f})}else if(f instanceof
|
|
|
a.LOD)d.setFromMatrixPosition(f.matrixWorld),t=n.ray.origin.distanceTo(d),l(f.getObjectForDistance(t),n,u);else if(f instanceof a.Mesh){var p=f.geometry;null===p.boundingSphere&&p.computeBoundingSphere();b.copy(p.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return u;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(null!==p.boundingBox&&!1===c.isIntersectionBox(p.boundingBox))return u;if(p instanceof a.BufferGeometry){var v=f.material;if(void 0===
|
|
a.LOD)d.setFromMatrixPosition(f.matrixWorld),t=n.ray.origin.distanceTo(d),l(f.getObjectForDistance(t),n,u);else if(f instanceof a.Mesh){var p=f.geometry;null===p.boundingSphere&&p.computeBoundingSphere();b.copy(p.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return u;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(null!==p.boundingBox&&!1===c.isIntersectionBox(p.boundingBox))return u;if(p instanceof a.BufferGeometry){var v=f.material;if(void 0===
|
|
|
-v||!1===p.dynamic)return u;var w,r,x=n.precision;if(void 0!==p.attributes.index)for(var A=p.offsets,G=p.attributes.index.array,P=p.attributes.position.array,I=p.offsets.length,C=p.attributes.index.array.length/3,C=0;C<I;++C)for(var t=A[C].start,B=A[C].index,p=t,L=t+A[C].count;p<L;p+=3)t=B+G[p],w=B+G[p+1],r=B+G[p+2],g.set(P[3*t],P[3*t+1],P[3*t+2]),h.set(P[3*w],P[3*w+1],P[3*w+2]),k.set(P[3*r],P[3*r+1],P[3*r+2]),w=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide),
|
|
|
|
|
-null!==w&&(w.applyMatrix4(f.matrixWorld),t=n.ray.origin.distanceTo(w),t<x||t<n.near||t>n.far||u.push({distance:t,point:w,face:null,faceIndex:null,object:f}));else for(P=p.attributes.position.array,C=p.attributes.position.array.length,p=0;p<C;p+=3)t=p,w=p+1,r=p+2,g.set(P[3*t],P[3*t+1],P[3*t+2]),h.set(P[3*w],P[3*w+1],P[3*w+2]),k.set(P[3*r],P[3*r+1],P[3*r+2]),w=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide),null!==w&&(w.applyMatrix4(f.matrixWorld),
|
|
|
|
|
-t=n.ray.origin.distanceTo(w),t<x||t<n.near||t>n.far||u.push({distance:t,point:w,face:null,faceIndex:null,object:f}))}else if(p instanceof a.Geometry)for(G=f.material instanceof a.MeshFaceMaterial,P=!0===G?f.material.materials:null,x=n.precision,A=p.vertices,I=0,C=p.faces.length;I<C;I++)if(B=p.faces[I],v=!0===G?P[B.materialIndex]:f.material,void 0!==v){t=A[B.a];w=A[B.b];r=A[B.c];if(!0===v.morphTargets){var L=p.morphTargets,H=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var J=
|
|
|
|
|
-0,y=L.length;J<y;J++){var N=H[J];if(0!==N){var z=L[J].vertices;g.x+=(z[B.a].x-t.x)*N;g.y+=(z[B.a].y-t.y)*N;g.z+=(z[B.a].z-t.z)*N;h.x+=(z[B.b].x-w.x)*N;h.y+=(z[B.b].y-w.y)*N;h.z+=(z[B.b].z-w.z)*N;k.x+=(z[B.c].x-r.x)*N;k.y+=(z[B.c].y-r.y)*N;k.z+=(z[B.c].z-r.z)*N}}g.add(t);h.add(w);k.add(r);t=g;w=h;r=k}w=v.side===a.BackSide?c.intersectTriangle(r,w,t,!0):c.intersectTriangle(t,w,r,v.side!==a.DoubleSide);null!==w&&(w.applyMatrix4(f.matrixWorld),t=n.ray.origin.distanceTo(w),t<x||t<n.near||t>n.far||u.push({distance:t,
|
|
|
|
|
-point:w,face:B,faceIndex:I,object:f}))}}else if(f instanceof a.Line){x=n.linePrecision;v=x*x;p=f.geometry;null===p.boundingSphere&&p.computeBoundingSphere();b.copy(p.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return u;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(p instanceof a.Geometry)for(A=p.vertices,x=A.length,w=new a.Vector3,r=new a.Vector3,C=f.type===a.LineStrip?1:2,p=0;p<x-1;p+=C)c.distanceSqToSegment(A[p],A[p+1],r,w)>v||(t=c.origin.distanceTo(r),
|
|
|
|
|
|
|
+v||!1===p.dynamic)return u;var w,r,x=n.precision;if(void 0!==p.attributes.index)for(var A=p.offsets,F=p.attributes.index.array,P=p.attributes.position.array,I=p.offsets.length,z=p.attributes.index.array.length/3,z=0;z<I;++z)for(var t=A[z].start,B=A[z].index,p=t,L=t+A[z].count;p<L;p+=3)t=B+F[p],w=B+F[p+1],r=B+F[p+2],g.set(P[3*t],P[3*t+1],P[3*t+2]),h.set(P[3*w],P[3*w+1],P[3*w+2]),k.set(P[3*r],P[3*r+1],P[3*r+2]),w=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide),
|
|
|
|
|
+null!==w&&(w.applyMatrix4(f.matrixWorld),t=n.ray.origin.distanceTo(w),t<x||t<n.near||t>n.far||u.push({distance:t,point:w,face:null,faceIndex:null,object:f}));else for(P=p.attributes.position.array,z=p.attributes.position.array.length,p=0;p<z;p+=3)t=p,w=p+1,r=p+2,g.set(P[3*t],P[3*t+1],P[3*t+2]),h.set(P[3*w],P[3*w+1],P[3*w+2]),k.set(P[3*r],P[3*r+1],P[3*r+2]),w=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide),null!==w&&(w.applyMatrix4(f.matrixWorld),
|
|
|
|
|
+t=n.ray.origin.distanceTo(w),t<x||t<n.near||t>n.far||u.push({distance:t,point:w,face:null,faceIndex:null,object:f}))}else if(p instanceof a.Geometry)for(F=f.material instanceof a.MeshFaceMaterial,P=!0===F?f.material.materials:null,x=n.precision,A=p.vertices,I=0,z=p.faces.length;I<z;I++)if(B=p.faces[I],v=!0===F?P[B.materialIndex]:f.material,void 0!==v){t=A[B.a];w=A[B.b];r=A[B.c];if(!0===v.morphTargets){var L=p.morphTargets,H=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var J=
|
|
|
|
|
+0,y=L.length;J<y;J++){var N=H[J];if(0!==N){var E=L[J].vertices;g.x+=(E[B.a].x-t.x)*N;g.y+=(E[B.a].y-t.y)*N;g.z+=(E[B.a].z-t.z)*N;h.x+=(E[B.b].x-w.x)*N;h.y+=(E[B.b].y-w.y)*N;h.z+=(E[B.b].z-w.z)*N;k.x+=(E[B.c].x-r.x)*N;k.y+=(E[B.c].y-r.y)*N;k.z+=(E[B.c].z-r.z)*N}}g.add(t);h.add(w);k.add(r);t=g;w=h;r=k}w=v.side===a.BackSide?c.intersectTriangle(r,w,t,!0):c.intersectTriangle(t,w,r,v.side!==a.DoubleSide);null!==w&&(w.applyMatrix4(f.matrixWorld),t=n.ray.origin.distanceTo(w),t<x||t<n.near||t>n.far||u.push({distance:t,
|
|
|
|
|
+point:w,face:B,faceIndex:I,object:f}))}}else if(f instanceof a.Line){x=n.linePrecision;v=x*x;p=f.geometry;null===p.boundingSphere&&p.computeBoundingSphere();b.copy(p.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return u;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(p instanceof a.Geometry)for(A=p.vertices,x=A.length,w=new a.Vector3,r=new a.Vector3,z=f.type===a.LineStrip?1:2,p=0;p<x-1;p+=z)c.distanceSqToSegment(A[p],A[p+1],r,w)>v||(t=c.origin.distanceTo(r),
|
|
|
t<n.near||t>n.far||u.push({distance:t,point:w.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},n=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&n(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,
|
|
t<n.near||t>n.far||u.push({distance:t,point:w.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},n=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&n(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,
|
|
|
b){for(var c=[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&n(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this._rotation=new THREE.Euler;this._quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this._rotation._quaternion=this.quaternion;this._quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
|
|
b){for(var c=[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&n(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this._rotation=new THREE.Euler;this._quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this._rotation._quaternion=this.quaternion;this._quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
|
|
|
this.visible=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
|
|
this.visible=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
|
|
@@ -162,20 +162,20 @@ b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name=
|
|
|
this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);
|
|
this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);
|
|
|
a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));
|
|
a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));
|
|
|
if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(n===s){var a=new THREE.RenderableVertex;q.push(a);s++;n++;return a}return q[n++]}function b(){if(t===v){var a=new THREE.RenderableFace3;p.push(a);v++;t++;return a}return p[t++]}function c(){if(r===A){var a=new THREE.RenderableLine;x.push(a);A++;r++;return a}return x[r++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&
|
|
if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(n===s){var a=new THREE.RenderableVertex;q.push(a);s++;n++;return a}return q[n++]}function b(){if(t===v){var a=new THREE.RenderableFace3;p.push(a);v++;t++;return a}return p[t++]}function c(){if(r===A){var a=new THREE.RenderableLine;x.push(a);A++;r++;return a}return x[r++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&
|
|
|
-0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,n,q=[],s=0,u,t,p=[],v=0,w,r,x=[],A=0,G,P,I=[],C=0,B={objects:[],sprites:[],lights:[],elements:[]},L=new THREE.Vector3,H=new THREE.Vector3,J=new THREE.Vector3,y=new THREE.Vector3,N=new THREE.Vector4,z=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),D=new THREE.Box3,E=Array(3),F=new THREE.Matrix4,
|
|
|
|
|
|
|
+0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,n,q=[],s=0,u,t,p=[],v=0,w,r,x=[],A=0,F,P,I=[],z=0,B={objects:[],sprites:[],lights:[],elements:[]},L=new THREE.Vector3,H=new THREE.Vector3,J=new THREE.Vector3,y=new THREE.Vector3,N=new THREE.Vector4,E=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),C=new THREE.Box3,D=Array(3),G=new THREE.Matrix4,
|
|
|
X=new THREE.Matrix4,T,ea=new THREE.Matrix4,Y=new THREE.Matrix3,la=new THREE.Matrix3,Q=new THREE.Vector3,ha=new THREE.Frustum,S=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);X.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(X)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);X.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(X)}}();
|
|
X=new THREE.Matrix4,T,ea=new THREE.Matrix4,Y=new THREE.Matrix3,la=new THREE.Matrix3,Q=new THREE.Vector3,ha=new THREE.Frustum,S=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);X.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(X)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);X.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(X)}}();
|
|
|
this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var R=function(a){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:(y.setFromMatrixPosition(a.matrixWorld),y.applyProjection(X),f.z=y.z);return f},ma=function(a){if(!1!==a.visible){a instanceof THREE.Light?B.lights.push(a):a instanceof
|
|
this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var R=function(a){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:(y.setFromMatrixPosition(a.matrixWorld),y.applyProjection(X),f.z=y.z);return f},ma=function(a){if(!1!==a.visible){a instanceof THREE.Light?B.lights.push(a):a instanceof
|
|
|
-THREE.Mesh||a instanceof THREE.Line?!1!==a.frustumCulled&&!0!==ha.intersectsObject(a)||B.objects.push(R(a)):a instanceof THREE.Sprite&&B.sprites.push(R(a));for(var b=0,c=a.children.length;b<c;b++)ma(a.children[b])}},fa=new function(){var d=null,e=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(T);c.copy(b).applyMatrix4(X);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},f=function(a,b,c){E[0]=a.positionScreen;E[1]=b.positionScreen;
|
|
|
|
|
-E[2]=c.positionScreen;return!0===a.visible||!0===b.visible||!0===c.visible||z.isIntersectionBox(D.setFromPoints(E))?0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x):!1};return{setObject:function(a){d=a},projectVertex:e,checkTriangleVisibility:f,handleVertex:function(b,c,d){l=a();l.position.set(b,c,d);e(l)},handleLine:function(a,b){w=c();w.id=d.id;w.v1.copy(q[a]);w.v2.copy(q[b]);w.material=
|
|
|
|
|
-d.material;B.elements.push(w)},handleTriangle:function(a,c,e){a=q[a];c=q[c];e=q[e];!0===f(a,c,e)&&(u=b(),u.id=d.id,u.v1.copy(a),u.v2.copy(c),u.v3.copy(e),u.material=d.material,B.elements.push(u))}}};this.projectScene=function(f,h,k,l){var p,s,v,x,y,A,z,E,D;P=r=t=0;B.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();F.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));X.multiplyMatrices(h.projectionMatrix,F);la.getNormalMatrix(F);ha.setFromMatrix(X);
|
|
|
|
|
|
|
+THREE.Mesh||a instanceof THREE.Line?!1!==a.frustumCulled&&!0!==ha.intersectsObject(a)||B.objects.push(R(a)):a instanceof THREE.Sprite&&B.sprites.push(R(a));for(var b=0,c=a.children.length;b<c;b++)ma(a.children[b])}},fa=new function(){var d=null,e=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(T);c.copy(b).applyMatrix4(X);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},f=function(a,b,c){D[0]=a.positionScreen;D[1]=b.positionScreen;
|
|
|
|
|
+D[2]=c.positionScreen;return!0===a.visible||!0===b.visible||!0===c.visible||E.isIntersectionBox(C.setFromPoints(D))?0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x):!1};return{setObject:function(a){d=a},projectVertex:e,checkTriangleVisibility:f,handleVertex:function(b,c,d){l=a();l.position.set(b,c,d);e(l)},handleLine:function(a,b){w=c();w.id=d.id;w.v1.copy(q[a]);w.v2.copy(q[b]);w.material=
|
|
|
|
|
+d.material;B.elements.push(w)},handleTriangle:function(a,c,e){a=q[a];c=q[c];e=q[e];!0===f(a,c,e)&&(u=b(),u.id=d.id,u.v1.copy(a),u.v2.copy(c),u.v3.copy(e),u.material=d.material,B.elements.push(u))}}};this.projectScene=function(f,h,k,l){var p,s,v,x,y,A,E,D,R;P=r=t=0;B.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();G.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));X.multiplyMatrices(h.projectionMatrix,G);la.getNormalMatrix(G);ha.setFromMatrix(X);
|
|
|
g=0;B.objects.length=0;B.sprites.length=0;B.lights.length=0;ma(f);!0===k&&B.objects.sort(d);f=0;for(k=B.objects.length;f<k;f++)if(p=B.objects[f].object,s=p.geometry,fa.setObject(p),T=p.matrixWorld,n=0,p instanceof THREE.Mesh)if(s instanceof THREE.BufferGeometry){if(x=s.attributes,void 0!==x.position){A=x.position.array;p=0;for(s=A.length;p<s;p+=3)fa.handleVertex(A[p],A[p+1],A[p+2]);if(void 0!==x.index)for(x=x.index.array,p=0,s=x.length;p<s;p+=3)fa.handleTriangle(x[p],x[p+1],x[p+2]);else for(p=0,s=
|
|
g=0;B.objects.length=0;B.sprites.length=0;B.lights.length=0;ma(f);!0===k&&B.objects.sort(d);f=0;for(k=B.objects.length;f<k;f++)if(p=B.objects[f].object,s=p.geometry,fa.setObject(p),T=p.matrixWorld,n=0,p instanceof THREE.Mesh)if(s instanceof THREE.BufferGeometry){if(x=s.attributes,void 0!==x.position){A=x.position.array;p=0;for(s=A.length;p<s;p+=3)fa.handleVertex(A[p],A[p+1],A[p+2]);if(void 0!==x.index)for(x=x.index.array,p=0,s=x.length;p<s;p+=3)fa.handleTriangle(x[p],x[p+1],x[p+2]);else for(p=0,s=
|
|
|
-A.length/3;p<s;p+=3)fa.handleTriangle(p,p+1,p+2)}}else{if(s instanceof THREE.Geometry){v=s.vertices;x=s.faces;A=s.faceVertexUvs;Y.getNormalMatrix(T);E=p.material instanceof THREE.MeshFaceMaterial;D=!0===E?p.material:null;for(var R=0,ya=v.length;R<ya;R++){var za=v[R];fa.handleVertex(za.x,za.y,za.z)}R=0;for(ya=x.length;R<ya;R++)if(v=x[R],za=!0===E?D.materials[v.materialIndex]:p.material,void 0!==za){z=za.side;y=q[v.a];var ja=q[v.b],Ea=q[v.c];if(!0===za.morphTargets){var Fa=s.morphTargets,pa=p.morphTargetInfluences,
|
|
|
|
|
|
|
+A.length/3;p<s;p+=3)fa.handleTriangle(p,p+1,p+2)}}else{if(s instanceof THREE.Geometry){v=s.vertices;x=s.faces;A=s.faceVertexUvs;Y.getNormalMatrix(T);D=p.material instanceof THREE.MeshFaceMaterial;R=!0===D?p.material:null;for(var C=0,ya=v.length;C<ya;C++){var za=v[C];fa.handleVertex(za.x,za.y,za.z)}C=0;for(ya=x.length;C<ya;C++)if(v=x[C],za=!0===D?R.materials[v.materialIndex]:p.material,void 0!==za){E=za.side;y=q[v.a];var ja=q[v.b],Ea=q[v.c];if(!0===za.morphTargets){var Fa=s.morphTargets,pa=p.morphTargetInfluences,
|
|
|
Aa=y.position,Ba=ja.position,$a=Ea.position;L.set(0,0,0);H.set(0,0,0);J.set(0,0,0);for(var Na=0,ga=Fa.length;Na<ga;Na++){var ia=pa[Na];if(0!==ia){var Ga=Fa[Na].vertices;L.x+=(Ga[v.a].x-Aa.x)*ia;L.y+=(Ga[v.a].y-Aa.y)*ia;L.z+=(Ga[v.a].z-Aa.z)*ia;H.x+=(Ga[v.b].x-Ba.x)*ia;H.y+=(Ga[v.b].y-Ba.y)*ia;H.z+=(Ga[v.b].z-Ba.z)*ia;J.x+=(Ga[v.c].x-$a.x)*ia;J.y+=(Ga[v.c].y-$a.y)*ia;J.z+=(Ga[v.c].z-$a.z)*ia}}y.position.add(L);ja.position.add(H);Ea.position.add(J);fa.projectVertex(y);fa.projectVertex(ja);fa.projectVertex(Ea)}Fa=
|
|
Aa=y.position,Ba=ja.position,$a=Ea.position;L.set(0,0,0);H.set(0,0,0);J.set(0,0,0);for(var Na=0,ga=Fa.length;Na<ga;Na++){var ia=pa[Na];if(0!==ia){var Ga=Fa[Na].vertices;L.x+=(Ga[v.a].x-Aa.x)*ia;L.y+=(Ga[v.a].y-Aa.y)*ia;L.z+=(Ga[v.a].z-Aa.z)*ia;H.x+=(Ga[v.b].x-Ba.x)*ia;H.y+=(Ga[v.b].y-Ba.y)*ia;H.z+=(Ga[v.b].z-Ba.z)*ia;J.x+=(Ga[v.c].x-$a.x)*ia;J.y+=(Ga[v.c].y-$a.y)*ia;J.z+=(Ga[v.c].z-$a.z)*ia}}y.position.add(L);ja.position.add(H);Ea.position.add(J);fa.projectVertex(y);fa.projectVertex(ja);fa.projectVertex(Ea)}Fa=
|
|
|
-fa.checkTriangleVisibility(y,ja,Ea);if(Fa!==(z===THREE.BackSide)){u=b();u.id=p.id;u.v1.copy(y);u.v2.copy(ja);u.v3.copy(Ea);u.normalModel.copy(v.normal);!1!==Fa||z!==THREE.BackSide&&z!==THREE.DoubleSide||u.normalModel.negate();u.normalModel.applyMatrix3(Y).normalize();u.normalModelView.copy(u.normalModel).applyMatrix3(la);u.centroidModel.copy(v.centroid).applyMatrix4(T);y=v.vertexNormals;ja=0;for(Ea=Math.min(y.length,3);ja<Ea;ja++)pa=u.vertexNormalsModel[ja],pa.copy(y[ja]),!1!==Fa||z!==THREE.BackSide&&
|
|
|
|
|
-z!==THREE.DoubleSide||pa.negate(),pa.applyMatrix3(Y).normalize(),u.vertexNormalsModelView[ja].copy(pa).applyMatrix3(la);u.vertexNormalsLength=y.length;y=0;for(ja=Math.min(A.length,3);y<ja;y++)if(z=A[y][R],void 0!==z)for(Ea=0,Fa=z.length;Ea<Fa;Ea++)u.uvs[y][Ea]=z[Ea];u.color=v.color;u.material=za;Q.copy(u.centroidModel).applyProjection(X);u.z=Q.z;B.elements.push(u)}}}}else if(p instanceof THREE.Line)if(s instanceof THREE.BufferGeometry){if(x=s.attributes,void 0!==x.position){A=x.position.array;p=0;
|
|
|
|
|
-for(s=A.length;p<s;p+=3)fa.handleVertex(A[p],A[p+1],A[p+2]);if(void 0!==x.index)for(x=x.index.array,p=0,s=x.length;p<s;p+=2)fa.handleLine(x[p],x[p+1]);else for(p=0,s=A.length/3-1;p<s;p++)fa.handleLine(p,p+1)}}else if(s instanceof THREE.Geometry)for(ea.multiplyMatrices(X,T),v=p.geometry.vertices,y=a(),y.positionScreen.copy(v[0]).applyMatrix4(ea),s=p.type===THREE.LinePieces?2:1,R=1,ya=v.length;R<ya;R++)y=a(),y.positionScreen.copy(v[R]).applyMatrix4(ea),0<(R+1)%s||(ja=q[n-2],S.copy(y.positionScreen),
|
|
|
|
|
-M.copy(ja.positionScreen),!0===e(S,M)&&(S.multiplyScalar(1/S.w),M.multiplyScalar(1/M.w),w=c(),w.id=p.id,w.v1.positionScreen.copy(S),w.v2.positionScreen.copy(M),w.z=Math.max(S.z,M.z),w.material=p.material,p.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(p.geometry.colors[R]),w.vertexColors[1].copy(p.geometry.colors[R-1])),B.elements.push(w)));f=0;for(k=B.sprites.length;f<k;f++)p=B.sprites[f].object,T=p.matrixWorld,N.set(T.elements[12],T.elements[13],T.elements[14],1),N.applyMatrix4(X),
|
|
|
|
|
-s=1/N.w,N.z*=s,-1<=N.z&&1>=N.z&&(P===C?(x=new THREE.RenderableSprite,I.push(x),C++,P++,G=x):G=I[P++],G.id=p.id,G.x=N.x*s,G.y=N.y*s,G.z=N.z,G.object=p,G.rotation=p.rotation,G.scale.x=p.scale.x*Math.abs(G.x-(N.x+h.projectionMatrix.elements[0])/(N.w+h.projectionMatrix.elements[12])),G.scale.y=p.scale.y*Math.abs(G.y-(N.y+h.projectionMatrix.elements[5])/(N.w+h.projectionMatrix.elements[13])),G.material=p.material,B.elements.push(G));!0===l&&B.elements.sort(d);return B}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
|
|
|
|
|
|
|
+fa.checkTriangleVisibility(y,ja,Ea);if(Fa!==(E===THREE.BackSide)){u=b();u.id=p.id;u.v1.copy(y);u.v2.copy(ja);u.v3.copy(Ea);u.normalModel.copy(v.normal);!1!==Fa||E!==THREE.BackSide&&E!==THREE.DoubleSide||u.normalModel.negate();u.normalModel.applyMatrix3(Y).normalize();u.normalModelView.copy(u.normalModel).applyMatrix3(la);u.centroidModel.copy(v.centroid).applyMatrix4(T);y=v.vertexNormals;ja=0;for(Ea=Math.min(y.length,3);ja<Ea;ja++)pa=u.vertexNormalsModel[ja],pa.copy(y[ja]),!1!==Fa||E!==THREE.BackSide&&
|
|
|
|
|
+E!==THREE.DoubleSide||pa.negate(),pa.applyMatrix3(Y).normalize(),u.vertexNormalsModelView[ja].copy(pa).applyMatrix3(la);u.vertexNormalsLength=y.length;y=0;for(ja=Math.min(A.length,3);y<ja;y++)if(E=A[y][C],void 0!==E)for(Ea=0,Fa=E.length;Ea<Fa;Ea++)u.uvs[y][Ea]=E[Ea];u.color=v.color;u.material=za;Q.copy(u.centroidModel).applyProjection(X);u.z=Q.z;B.elements.push(u)}}}}else if(p instanceof THREE.Line)if(s instanceof THREE.BufferGeometry){if(x=s.attributes,void 0!==x.position){A=x.position.array;p=0;
|
|
|
|
|
+for(s=A.length;p<s;p+=3)fa.handleVertex(A[p],A[p+1],A[p+2]);if(void 0!==x.index)for(x=x.index.array,p=0,s=x.length;p<s;p+=2)fa.handleLine(x[p],x[p+1]);else for(p=0,s=A.length/3-1;p<s;p++)fa.handleLine(p,p+1)}}else if(s instanceof THREE.Geometry)for(ea.multiplyMatrices(X,T),v=p.geometry.vertices,y=a(),y.positionScreen.copy(v[0]).applyMatrix4(ea),s=p.type===THREE.LinePieces?2:1,C=1,ya=v.length;C<ya;C++)y=a(),y.positionScreen.copy(v[C]).applyMatrix4(ea),0<(C+1)%s||(ja=q[n-2],S.copy(y.positionScreen),
|
|
|
|
|
+M.copy(ja.positionScreen),!0===e(S,M)&&(S.multiplyScalar(1/S.w),M.multiplyScalar(1/M.w),w=c(),w.id=p.id,w.v1.positionScreen.copy(S),w.v2.positionScreen.copy(M),w.z=Math.max(S.z,M.z),w.material=p.material,p.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(p.geometry.colors[C]),w.vertexColors[1].copy(p.geometry.colors[C-1])),B.elements.push(w)));f=0;for(k=B.sprites.length;f<k;f++)p=B.sprites[f].object,T=p.matrixWorld,N.set(T.elements[12],T.elements[13],T.elements[14],1),N.applyMatrix4(X),
|
|
|
|
|
+s=1/N.w,N.z*=s,-1<=N.z&&1>=N.z&&(P===z?(x=new THREE.RenderableSprite,I.push(x),z++,P++,F=x):F=I[P++],F.id=p.id,F.x=N.x*s,F.y=N.y*s,F.z=N.z,F.object=p,F.rotation=p.rotation,F.scale.x=p.scale.x*Math.abs(F.x-(N.x+h.projectionMatrix.elements[0])/(N.w+h.projectionMatrix.elements[12])),F.scale.y=p.scale.y*Math.abs(F.y-(N.y+h.projectionMatrix.elements[5])/(N.w+h.projectionMatrix.elements[13])),F.material=p.material,B.elements.push(F));!0===l&&B.elements.sort(d);return B}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
|
|
|
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
|
|
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
|
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
|
|
|
this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
@@ -185,9 +185,9 @@ g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(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],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
|
|
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],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
|
|
|
e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=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=
|
|
e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=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,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}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],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<
|
|
this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}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],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.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(){var a,b,c,d,e,f,g,h,k,l,n,q,s,u,t,p,v,w=[],r=[];c=new THREE.Vector3;var x=new THREE.Vector3,A=new THREE.Vector3,G=new THREE.Vector3,P=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,r[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],
|
|
|
|
|
|
|
+d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,q,s,u,t,p,v,w=[],r=[];c=new THREE.Vector3;var x=new THREE.Vector3,A=new THREE.Vector3,F=new THREE.Vector3,P=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,r[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],
|
|
|
l=f[0],n=f[1],q=f[2],f=h.x-g.x,s=k.x-g.x,u=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,p=q.x-l.x,n=n.y-l.y,l=q.y-l.y,q=1/(k*l-p*n),c.set((l*f-n*s)*q,(l*u-n*t)*q,(l*h-n*g)*q),x.set((k*s-p*f)*q,(k*t-p*u)*q,(k*g-p*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),r[d].add(x),r[v].add(x),r[e].add(x);x=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)P.copy(e.vertexNormals[c]),d=e[x[c]],v=w[d],A.copy(v),A.sub(P.multiplyScalar(P.dot(v))).normalize(),
|
|
l=f[0],n=f[1],q=f[2],f=h.x-g.x,s=k.x-g.x,u=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,p=q.x-l.x,n=n.y-l.y,l=q.y-l.y,q=1/(k*l-p*n),c.set((l*f-n*s)*q,(l*u-n*t)*q,(l*h-n*g)*q),x.set((k*s-p*f)*q,(k*t-p*u)*q,(k*g-p*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),r[d].add(x),r[v].add(x),r[e].add(x);x=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)P.copy(e.vertexNormals[c]),d=e[x[c]],v=w[d],A.copy(v),A.sub(P.multiplyScalar(P.dot(v))).normalize(),
|
|
|
-G.crossVectors(e.vertexNormals[c],v),d=G.dot(r[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},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);
|
|
|
|
|
|
|
+F.crossVectors(e.vertexNormals[c],v),d=F.dot(r[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},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)},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=
|
|
this.boundingSphere.setFromPoints(this.vertices)},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},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},
|
|
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},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},
|
|
|
dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.attributes={};this.dynamic=!0;this.offsets=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.morphTargets=[]};
|
|
dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.attributes={};this.dynamic=!0;this.offsets=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.morphTargets=[]};
|
|
@@ -197,9 +197,9 @@ new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&
|
|
|
b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,n,q,s=new THREE.Vector3,u=new THREE.Vector3,t=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;if(this.attributes.index){var w=this.attributes.index.array,r=this.offsets;c=0;for(d=
|
|
b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,n,q,s=new THREE.Vector3,u=new THREE.Vector3,t=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;if(this.attributes.index){var w=this.attributes.index.array,r=this.offsets;c=0;for(d=
|
|
|
r.length;c<d;++c){b=r[c].start;g=r[c].count;var x=r[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],s.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],u.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],t.set(l,n,q),p.subVectors(t,u),v.subVectors(s,u),p.cross(v),f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],s.set(l,n,q),l=e[a+3],n=e[a+4],
|
|
r.length;c<d;++c){b=r[c].start;g=r[c].count;var x=r[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],s.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],u.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],t.set(l,n,q),p.subVectors(t,u),v.subVectors(s,u),p.cross(v),f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],s.set(l,n,q),l=e[a+3],n=e[a+4],
|
|
|
q=e[a+5],u.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],t.set(l,n,q),p.subVectors(t,u),v.subVectors(s,u),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},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},computeTangents:function(){function a(a,b,c){q=d[3*a];s=d[3*a+1];
|
|
q=e[a+5],u.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],t.set(l,n,q),p.subVectors(t,u),v.subVectors(s,u),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},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},computeTangents:function(){function a(a,b,c){q=d[3*a];s=d[3*a+1];
|
|
|
-u=d[3*a+2];t=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];r=d[3*c+1];x=d[3*c+2];A=f[2*a];G=f[2*a+1];P=f[2*b];I=f[2*b+1];C=f[2*c];B=f[2*c+1];L=t-q;H=w-q;J=p-s;y=r-s;N=v-u;z=x-u;D=P-A;E=C-A;F=I-G;X=B-G;T=1/(D*X-E*F);ea.set((X*L-F*H)*T,(X*J-F*y)*T,(X*N-F*z)*T);Y.set((D*H-E*L)*T,(D*y-E*J)*T,(D*z-E*N)*T);k[a].add(ea);k[b].add(ea);k[c].add(ea);l[a].add(Y);l[b].add(Y);l[c].add(Y)}function b(a){U.x=e[3*a];U.y=e[3*a+1];U.z=e[3*a+2];aa.copy(U);oa=k[a];fa.copy(oa);fa.sub(U.multiplyScalar(U.dot(oa))).normalize();Ka.crossVectors(aa,
|
|
|
|
|
|
|
+u=d[3*a+2];t=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];r=d[3*c+1];x=d[3*c+2];A=f[2*a];F=f[2*a+1];P=f[2*b];I=f[2*b+1];z=f[2*c];B=f[2*c+1];L=t-q;H=w-q;J=p-s;y=r-s;N=v-u;E=x-u;C=P-A;D=z-A;G=I-F;X=B-F;T=1/(C*X-D*G);ea.set((X*L-G*H)*T,(X*J-G*y)*T,(X*N-G*E)*T);Y.set((C*H-D*L)*T,(C*y-D*J)*T,(C*E-D*N)*T);k[a].add(ea);k[b].add(ea);k[c].add(ea);l[a].add(Y);l[b].add(Y);l[c].add(Y)}function b(a){U.x=e[3*a];U.y=e[3*a+1];U.z=e[3*a+2];aa.copy(U);oa=k[a];fa.copy(oa);fa.sub(U.multiplyScalar(U.dot(oa))).normalize();Ka.crossVectors(aa,
|
|
|
oa);xa=Ka.dot(l[a]);Ca=0>xa?-1:1;h[4*a]=fa.x;h[4*a+1]=fa.y;h[4*a+2]=fa.z;h[4*a+3]=Ca}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&
|
|
oa);xa=Ka.dot(l[a]);Ca=0>xa?-1:1;h[4*a]=fa.x;h[4*a+1]=fa.y;h[4*a+2]=fa.z;h[4*a+3]=Ca}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&
|
|
|
-(this.attributes.tangent={itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,s,u,t,p,v,w,r,x,A,G,P,I,C,B,L,H,J,y,N,z,D,E,F,X,T,ea=new THREE.Vector3,Y=new THREE.Vector3,la,Q,ha,S,M,R=this.offsets,n=0;for(Q=R.length;n<Q;++n){la=R[n].start;ha=R[n].count;var ma=R[n].index,g=la;for(la+=ha;g<la;g+=3)ha=ma+c[g],S=ma+c[g+1],M=ma+c[g+2],a(ha,S,M)}var fa=new THREE.Vector3,Ka=new THREE.Vector3,U=new THREE.Vector3,
|
|
|
|
|
|
|
+(this.attributes.tangent={itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,s,u,t,p,v,w,r,x,A,F,P,I,z,B,L,H,J,y,N,E,C,D,G,X,T,ea=new THREE.Vector3,Y=new THREE.Vector3,la,Q,ha,S,M,R=this.offsets,n=0;for(Q=R.length;n<Q;++n){la=R[n].start;ha=R[n].count;var ma=R[n].index,g=la;for(la+=ha;g<la;g+=3)ha=ma+c[g],S=ma+c[g+1],M=ma+c[g+2],a(ha,S,M)}var fa=new THREE.Vector3,Ka=new THREE.Vector3,U=new THREE.Vector3,
|
|
|
aa=new THREE.Vector3,Ca,oa,xa,n=0;for(Q=R.length;n<Q;++n)for(la=R[n].start,ha=R[n].count,ma=R[n].index,g=la,la+=ha;g<la;g+=3)ha=ma+c[g],S=ma+c[g+1],M=ma+c[g+2],b(ha),b(S),b(M);this.tangentsNeedUpdate=this.hasTangents=!0}},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,array:null},d=0,g=b.length;d<
|
|
aa=new THREE.Vector3,Ca,oa,xa,n=0;for(Q=R.length;n<Q;++n)for(la=R[n].start,ha=R[n].count,ma=R[n].index,g=la,la+=ha;g<la;g+=3)ha=ma+c[g],S=ma+c[g+1],M=ma+c[g+2],b(ha),b(S),b(M);this.tangentsNeedUpdate=this.hasTangents=!0}},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,array:null},d=0,g=b.length;d<
|
|
|
g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
|
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
|
|
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
|
|
@@ -223,9 +223,9 @@ THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){va
|
|
|
THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=document.createElement("img");void 0!==b&&f.addEventListener("load",function(c){e.manager.itemEnd(a);b(this)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);f.src=a;e.manager.itemStart(a);return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
|
|
THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=document.createElement("img");void 0!==b&&f.addEventListener("load",function(c){e.manager.itemEnd(a);b(this)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);f.src=a;e.manager.itemStart(a);return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
|
|
|
THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),h=a.parse(h,d);c(h.geometry,h.materials)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else f.readyState===f.LOADING?e&&(0===g&&
|
|
THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),h=a.parse(h,d);c(h.geometry,h.materials)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else f.readyState===f.LOADING?e&&(0===g&&
|
|
|
(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
|
|
(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
|
|
|
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,q,s,u,t,p,v,w,r=a.faces;n=a.vertices;var x=a.normals,A=a.colors,G=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&G++;for(d=0;d<G;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=r.length;k<l;)if(b=r[k++],u=b&1,h=b&2,d=b&8,q=b&16,t=b&32,n=b&64,b&=128,u){u=new THREE.Face3;
|
|
|
|
|
-u.a=r[k];u.b=r[k+1];u.c=r[k+3];p=new THREE.Face3;p.a=r[k+1];p.b=r[k+2];p.c=r[k+3];k+=4;h&&(h=r[k++],u.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)s=r[k++],w=v[2*s],s=v[2*s+1],w=new THREE.Vector2(w,s),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*r[k++],u.normal.set(x[q++],x[q++],x[q]),p.normal.copy(u.normal));if(t)for(d=0;4>d;d++)q=3*r[k++],t=new THREE.Vector3(x[q++],
|
|
|
|
|
-x[q++],x[q]),2!==d&&u.vertexNormals.push(t),0!==d&&p.vertexNormals.push(t);n&&(n=r[k++],n=A[n],u.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=r[k++],n=A[n],2!==d&&u.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(u);c.faces.push(p)}else{u=new THREE.Face3;u.a=r[k++];u.b=r[k++];u.c=r[k++];h&&(h=r[k++],u.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)s=r[k++],w=v[2*s],s=v[2*s+1],
|
|
|
|
|
|
|
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,q,s,u,t,p,v,w,r=a.faces;n=a.vertices;var x=a.normals,A=a.colors,F=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&F++;for(d=0;d<F;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=r.length;k<l;)if(b=r[k++],u=b&1,h=b&2,d=b&8,q=b&16,t=b&32,n=b&64,b&=128,u){u=new THREE.Face3;
|
|
|
|
|
+u.a=r[k];u.b=r[k+1];u.c=r[k+3];p=new THREE.Face3;p.a=r[k+1];p.b=r[k+2];p.c=r[k+3];k+=4;h&&(h=r[k++],u.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)s=r[k++],w=v[2*s],s=v[2*s+1],w=new THREE.Vector2(w,s),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*r[k++],u.normal.set(x[q++],x[q++],x[q]),p.normal.copy(u.normal));if(t)for(d=0;4>d;d++)q=3*r[k++],t=new THREE.Vector3(x[q++],
|
|
|
|
|
+x[q++],x[q]),2!==d&&u.vertexNormals.push(t),0!==d&&p.vertexNormals.push(t);n&&(n=r[k++],n=A[n],u.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=r[k++],n=A[n],2!==d&&u.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(u);c.faces.push(p)}else{u=new THREE.Face3;u.a=r[k++];u.b=r[k++];u.c=r[k++];h&&(h=r[k++],u.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)s=r[k++],w=v[2*s],s=v[2*s+1],
|
|
|
w=new THREE.Vector2(w,s),c.faceVertexUvs[d][h].push(w);q&&(q=3*r[k++],u.normal.set(x[q++],x[q++],x[q]));if(t)for(d=0;3>d;d++)q=3*r[k++],t=new THREE.Vector3(x[q++],x[q++],x[q]),u.vertexNormals.push(t);n&&(n=r[k++],u.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=r[k++],u.vertexColors.push(new THREE.Color(A[n]));c.faces.push(u)}})(d);(function(){var b,d,g,h;if(a.skinWeights)for(b=0,d=a.skinWeights.length;b<d;b+=2)g=a.skinWeights[b],h=a.skinWeights[b+1],c.skinWeights.push(new THREE.Vector4(g,h,0,0));if(a.skinIndices)for(b=
|
|
w=new THREE.Vector2(w,s),c.faceVertexUvs[d][h].push(w);q&&(q=3*r[k++],u.normal.set(x[q++],x[q++],x[q]));if(t)for(d=0;3>d;d++)q=3*r[k++],t=new THREE.Vector3(x[q++],x[q++],x[q]),u.vertexNormals.push(t);n&&(n=r[k++],u.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=r[k++],u.vertexColors.push(new THREE.Color(A[n]));c.faces.push(u)}})(d);(function(){var b,d,g,h;if(a.skinWeights)for(b=0,d=a.skinWeights.length;b<d;b+=2)g=a.skinWeights[b],h=a.skinWeights[b+1],c.skinWeights.push(new THREE.Vector4(g,h,0,0));if(a.skinIndices)for(b=
|
|
|
0,d=a.skinIndices.length;b<d;b+=2)g=a.skinIndices[b],h=a.skinIndices[b+1],c.skinIndices.push(new THREE.Vector4(g,h,0,0));c.bones=a.bones;c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*
|
|
0,d=a.skinIndices.length;b<d;b+=2)g=a.skinIndices[b],h=a.skinIndices[b+1],c.skinIndices.push(new THREE.Vector4(g,h,0,0));c.bones=a.bones;c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*
|
|
|
b;q.y=n[h+1]*b;q.z=n[h+2]*b;l.push(q)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeCentroids();c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&
|
|
b;q.y=n[h+1]*b;q.z=n[h+2]*b;l.push(q)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeCentroids();c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&
|
|
@@ -241,29 +241,29 @@ d.parse(h.data);break;case "Geometry":g=c.parse(h.data).geometry}g.uuid=h.uuid;v
|
|
|
b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,
|
|
b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,
|
|
|
b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;case "Sprite":f=d[b.material];void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?
|
|
b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;case "Sprite":f=d[b.material];void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?
|
|
|
(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
|
|
(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
|
|
|
-THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b,c,d){var e=this;c=new THREE.XHRLoader(e.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(c){e.parse(JSON.parse(c),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:u+"/"+a}function e(){f(C.scene,
|
|
|
|
|
-L.objects)}function f(a,b){var c,e,g,h,l,n;for(n in b){var q=C.objects[n],r=b[n];if(void 0===q){if(r.type&&r.type in s.hierarchyHandlers){if(void 0===r.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};var u={},w;for(w in r)w in c||(u[w]=r[w]);p=C.materials[r.material];r.loading=!0;c=s.hierarchyHandlers[r.type].loaderObject;c.options?c.load(d(r.url,L.urlBaseType),k(n,a,p,r)):c.load(d(r.url,L.urlBaseType),k(n,
|
|
|
|
|
-a,p,r),u)}}else if(void 0!==r.geometry){if(t=C.geometries[r.geometry]){q=!1;p=C.materials[r.material];q=p instanceof THREE.ShaderMaterial;e=r.position;g=r.rotation;h=r.scale;c=r.matrix;l=r.quaternion;r.material||(p=new THREE.MeshFaceMaterial(C.face_materials[r.geometry]));p instanceof THREE.MeshFaceMaterial&&0===p.materials.length&&(p=new THREE.MeshFaceMaterial(C.face_materials[r.geometry]));if(p instanceof THREE.MeshFaceMaterial)for(u=0;u<p.materials.length;u++)q=q||p.materials[u]instanceof THREE.ShaderMaterial;
|
|
|
|
|
|
|
+THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b,c,d){var e=this;c=new THREE.XHRLoader(e.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(c){e.parse(JSON.parse(c),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:u+"/"+a}function e(){f(z.scene,
|
|
|
|
|
+L.objects)}function f(a,b){var c,e,g,h,l,n;for(n in b){var q=z.objects[n],r=b[n];if(void 0===q){if(r.type&&r.type in s.hierarchyHandlers){if(void 0===r.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};var u={},w;for(w in r)w in c||(u[w]=r[w]);p=z.materials[r.material];r.loading=!0;c=s.hierarchyHandlers[r.type].loaderObject;c.options?c.load(d(r.url,L.urlBaseType),k(n,a,p,r)):c.load(d(r.url,L.urlBaseType),k(n,
|
|
|
|
|
+a,p,r),u)}}else if(void 0!==r.geometry){if(t=z.geometries[r.geometry]){q=!1;p=z.materials[r.material];q=p instanceof THREE.ShaderMaterial;e=r.position;g=r.rotation;h=r.scale;c=r.matrix;l=r.quaternion;r.material||(p=new THREE.MeshFaceMaterial(z.face_materials[r.geometry]));p instanceof THREE.MeshFaceMaterial&&0===p.materials.length&&(p=new THREE.MeshFaceMaterial(z.face_materials[r.geometry]));if(p instanceof THREE.MeshFaceMaterial)for(u=0;u<p.materials.length;u++)q=q||p.materials[u]instanceof THREE.ShaderMaterial;
|
|
|
q&&t.computeTangents();r.skin?q=new THREE.SkinnedMesh(t,p):r.morph?(q=new THREE.MorphAnimMesh(t,p),void 0!==r.duration&&(q.duration=r.duration),void 0!==r.time&&(q.time=r.time),void 0!==r.mirroredLoop&&(q.mirroredLoop=r.mirroredLoop),p.morphNormals&&t.computeMorphNormals()):q=new THREE.Mesh(t,p);q.name=n;c?(q.matrixAutoUpdate=!1,q.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(q.position.fromArray(e),l?q.quaternion.fromArray(l):q.rotation.fromArray(g),
|
|
q&&t.computeTangents();r.skin?q=new THREE.SkinnedMesh(t,p):r.morph?(q=new THREE.MorphAnimMesh(t,p),void 0!==r.duration&&(q.duration=r.duration),void 0!==r.time&&(q.time=r.time),void 0!==r.mirroredLoop&&(q.mirroredLoop=r.mirroredLoop),p.morphNormals&&t.computeMorphNormals()):q=new THREE.Mesh(t,p);q.name=n;c?(q.matrixAutoUpdate=!1,q.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(q.position.fromArray(e),l?q.quaternion.fromArray(l):q.rotation.fromArray(g),
|
|
|
-q.scale.fromArray(h));q.visible=r.visible;q.castShadow=r.castShadow;q.receiveShadow=r.receiveShadow;a.add(q);C.objects[n]=q}}else if("AmbientLight"===r.type||"PointLight"===r.type||"DirectionalLight"===r.type||"SpotLight"===r.type||"HemisphereLight"===r.type||"AreaLight"===r.type){u=r.color;c=r.intensity;e=r.distance;g=r.position;h=r.rotation;switch(r.type){case "AmbientLight":x=new THREE.AmbientLight(u);break;case "PointLight":x=new THREE.PointLight(u,c,e);x.position.fromArray(g);break;case "DirectionalLight":x=
|
|
|
|
|
|
|
+q.scale.fromArray(h));q.visible=r.visible;q.castShadow=r.castShadow;q.receiveShadow=r.receiveShadow;a.add(q);z.objects[n]=q}}else if("AmbientLight"===r.type||"PointLight"===r.type||"DirectionalLight"===r.type||"SpotLight"===r.type||"HemisphereLight"===r.type||"AreaLight"===r.type){u=r.color;c=r.intensity;e=r.distance;g=r.position;h=r.rotation;switch(r.type){case "AmbientLight":x=new THREE.AmbientLight(u);break;case "PointLight":x=new THREE.PointLight(u,c,e);x.position.fromArray(g);break;case "DirectionalLight":x=
|
|
|
new THREE.DirectionalLight(u,c);x.position.fromArray(r.direction);break;case "SpotLight":x=new THREE.SpotLight(u,c,e,1);x.angle=r.angle;x.position.fromArray(g);x.target.set(g[0],g[1]-e,g[2]);x.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "HemisphereLight":x=new THREE.DirectionalLight(u,c,e);x.target.set(g[0],g[1]-e,g[2]);x.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "AreaLight":x=new THREE.AreaLight(u,c),x.position.fromArray(g),x.width=r.size,x.height=
|
|
new THREE.DirectionalLight(u,c);x.position.fromArray(r.direction);break;case "SpotLight":x=new THREE.SpotLight(u,c,e,1);x.angle=r.angle;x.position.fromArray(g);x.target.set(g[0],g[1]-e,g[2]);x.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "HemisphereLight":x=new THREE.DirectionalLight(u,c,e);x.target.set(g[0],g[1]-e,g[2]);x.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "AreaLight":x=new THREE.AreaLight(u,c),x.position.fromArray(g),x.width=r.size,x.height=
|
|
|
-r.size_y}a.add(x);x.name=n;C.lights[n]=x;C.objects[n]=x}else"PerspectiveCamera"===r.type||"OrthographicCamera"===r.type?(e=r.position,g=r.rotation,l=r.quaternion,"PerspectiveCamera"===r.type?v=new THREE.PerspectiveCamera(r.fov,r.aspect,r.near,r.far):"OrthographicCamera"===r.type&&(v=new THREE.OrthographicCamera(r.left,r.right,r.top,r.bottom,r.near,r.far)),v.name=n,v.position.fromArray(e),void 0!==l?v.quaternion.fromArray(l):void 0!==g&&v.rotation.fromArray(g),a.add(v),C.cameras[n]=v,C.objects[n]=
|
|
|
|
|
-v):(e=r.position,g=r.rotation,h=r.scale,l=r.quaternion,q=new THREE.Object3D,q.name=n,q.position.fromArray(e),l?q.quaternion.fromArray(l):q.rotation.fromArray(g),q.scale.fromArray(h),q.visible=void 0!==r.visible?r.visible:!1,a.add(q),C.objects[n]=q,C.empties[n]=q);if(q){if(void 0!==r.userData)for(var y in r.userData)q.userData[y]=r.userData[y];if(void 0!==r.groups)for(u=0;u<r.groups.length;u++)c=r.groups[u],void 0===C.groups[c]&&(C.groups[c]=[]),C.groups[c].push(n)}}void 0!==q&&void 0!==r.children&&
|
|
|
|
|
-f(q,r.children)}}function g(a,b,c,d,f){var g=f.rotation,h=f.quaternion,k=f.scale;a.position.fromArray(f.position);h?a.quaternion.fromArray(h):a.rotation.fromArray(g);a.scale.fromArray(k);d&&a.traverse(function(a){a.material=d});var l=void 0!==f.visible?f.visible:!0;a.traverse(function(a){a.visible=l});c.add(a);a.name=b;C.objects[b]=a;e()}function h(a){return function(b,c){b.name=a;C.geometries[a]=b;C.face_materials[a]=c;e();A-=1;s.onLoadComplete();n()}}function k(a,b,c,d){return function(e){g(e.content?
|
|
|
|
|
-e.content:e.dae?e.scene:e,a,b,c,d);A-=1;s.onLoadComplete();n()}}function l(a){return function(b,c){b.name=a;C.geometries[a]=b;C.face_materials[a]=c}}function n(){s.callbackProgress({totalModels:P,totalTextures:I,loadedModels:P-A,loadedTextures:I-G},C);s.onLoadProgress();if(0===A&&0===G){for(var a=0;a<B.length;a++){var c=B[a],d=C.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,C.scene.add(c.object.target));c.object.target.userData.targetInverse=c.object}b(C)}}function q(a,
|
|
|
|
|
-b){b(a);if(void 0!==a.children)for(var c in a.children)q(a.children[c],b)}var s=this,u=THREE.Loader.prototype.extractUrlBase(c),t,p,v,w,r,x,A,G,P,I,C,B=[],L=a,H;for(H in this.geometryHandlers)a=this.geometryHandlers[H].loaderClass,this.geometryHandlers[H].loaderObject=new a;for(H in this.hierarchyHandlers)a=this.hierarchyHandlers[H].loaderClass,this.hierarchyHandlers[H].loaderObject=new a;G=A=0;C={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},
|
|
|
|
|
-lights:{},fogs:{},empties:{},groups:{}};L.transform&&(H=L.transform.position,a=L.transform.rotation,c=L.transform.scale,H&&C.scene.position.fromArray(H),a&&C.scene.rotation.fromArray(a),c&&C.scene.scale.fromArray(c),H||a||c)&&(C.scene.updateMatrix(),C.scene.updateMatrixWorld());H=function(a){return function(){G-=a;n();s.onLoadComplete()}};for(var J in L.fogs)a=L.fogs[J],"linear"===a.type?w=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(w=new THREE.FogExp2(0,a.density)),a=a.color,w.color.setRGB(a[0],
|
|
|
|
|
-a[1],a[2]),C.fogs[J]=w;for(var y in L.geometries)w=L.geometries[y],w.type in this.geometryHandlers&&(A+=1,s.onLoadStart());for(var N in L.objects)q(L.objects[N],function(a){a.type&&a.type in s.hierarchyHandlers&&(A+=1,s.onLoadStart())});P=A;for(y in L.geometries)if(w=L.geometries[y],"cube"===w.type)t=new THREE.BoxGeometry(w.width,w.height,w.depth,w.widthSegments,w.heightSegments,w.depthSegments),t.name=y,C.geometries[y]=t;else if("plane"===w.type)t=new THREE.PlaneGeometry(w.width,w.height,w.widthSegments,
|
|
|
|
|
-w.heightSegments),t.name=y,C.geometries[y]=t;else if("sphere"===w.type)t=new THREE.SphereGeometry(w.radius,w.widthSegments,w.heightSegments),t.name=y,C.geometries[y]=t;else if("cylinder"===w.type)t=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),t.name=y,C.geometries[y]=t;else if("torus"===w.type)t=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),t.name=y,C.geometries[y]=t;else if("icosahedron"===w.type)t=new THREE.IcosahedronGeometry(w.radius,w.subdivisions),
|
|
|
|
|
-t.name=y,C.geometries[y]=t;else if(w.type in this.geometryHandlers){N={};for(r in w)"type"!==r&&"url"!==r&&(N[r]=w[r]);this.geometryHandlers[w.type].loaderObject.load(d(w.url,L.urlBaseType),h(y),N)}else"embedded"===w.type&&(N=L.embeds[w.id],N.metadata=L.metadata,N&&(N=this.geometryHandlers.ascii.loaderObject.parse(N,""),l(y)(N.geometry,N.materials)));for(var z in L.textures)if(y=L.textures[z],y.url instanceof Array)for(G+=y.url.length,r=0;r<y.url.length;r++)s.onLoadStart();else G+=1,s.onLoadStart();
|
|
|
|
|
-I=G;for(z in L.textures){y=L.textures[z];void 0!==y.mapping&&void 0!==THREE[y.mapping]&&(y.mapping=new THREE[y.mapping]);if(y.url instanceof Array){N=y.url.length;w=[];for(r=0;r<N;r++)w[r]=d(y.url[r],L.urlBaseType);r=(r=/\.dds$/i.test(w[0]))?THREE.ImageUtils.loadCompressedTextureCube(w,y.mapping,H(N)):THREE.ImageUtils.loadTextureCube(w,y.mapping,H(N))}else r=/\.dds$/i.test(y.url),N=d(y.url,L.urlBaseType),w=H(1),r=r?THREE.ImageUtils.loadCompressedTexture(N,y.mapping,w):THREE.ImageUtils.loadTexture(N,
|
|
|
|
|
|
|
+r.size_y}a.add(x);x.name=n;z.lights[n]=x;z.objects[n]=x}else"PerspectiveCamera"===r.type||"OrthographicCamera"===r.type?(e=r.position,g=r.rotation,l=r.quaternion,"PerspectiveCamera"===r.type?v=new THREE.PerspectiveCamera(r.fov,r.aspect,r.near,r.far):"OrthographicCamera"===r.type&&(v=new THREE.OrthographicCamera(r.left,r.right,r.top,r.bottom,r.near,r.far)),v.name=n,v.position.fromArray(e),void 0!==l?v.quaternion.fromArray(l):void 0!==g&&v.rotation.fromArray(g),a.add(v),z.cameras[n]=v,z.objects[n]=
|
|
|
|
|
+v):(e=r.position,g=r.rotation,h=r.scale,l=r.quaternion,q=new THREE.Object3D,q.name=n,q.position.fromArray(e),l?q.quaternion.fromArray(l):q.rotation.fromArray(g),q.scale.fromArray(h),q.visible=void 0!==r.visible?r.visible:!1,a.add(q),z.objects[n]=q,z.empties[n]=q);if(q){if(void 0!==r.userData)for(var y in r.userData)q.userData[y]=r.userData[y];if(void 0!==r.groups)for(u=0;u<r.groups.length;u++)c=r.groups[u],void 0===z.groups[c]&&(z.groups[c]=[]),z.groups[c].push(n)}}void 0!==q&&void 0!==r.children&&
|
|
|
|
|
+f(q,r.children)}}function g(a,b,c,d,f){var g=f.rotation,h=f.quaternion,k=f.scale;a.position.fromArray(f.position);h?a.quaternion.fromArray(h):a.rotation.fromArray(g);a.scale.fromArray(k);d&&a.traverse(function(a){a.material=d});var l=void 0!==f.visible?f.visible:!0;a.traverse(function(a){a.visible=l});c.add(a);a.name=b;z.objects[b]=a;e()}function h(a){return function(b,c){b.name=a;z.geometries[a]=b;z.face_materials[a]=c;e();A-=1;s.onLoadComplete();n()}}function k(a,b,c,d){return function(e){g(e.content?
|
|
|
|
|
+e.content:e.dae?e.scene:e,a,b,c,d);A-=1;s.onLoadComplete();n()}}function l(a){return function(b,c){b.name=a;z.geometries[a]=b;z.face_materials[a]=c}}function n(){s.callbackProgress({totalModels:P,totalTextures:I,loadedModels:P-A,loadedTextures:I-F},z);s.onLoadProgress();if(0===A&&0===F){for(var a=0;a<B.length;a++){var c=B[a],d=z.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,z.scene.add(c.object.target));c.object.target.userData.targetInverse=c.object}b(z)}}function q(a,
|
|
|
|
|
+b){b(a);if(void 0!==a.children)for(var c in a.children)q(a.children[c],b)}var s=this,u=THREE.Loader.prototype.extractUrlBase(c),t,p,v,w,r,x,A,F,P,I,z,B=[],L=a,H;for(H in this.geometryHandlers)a=this.geometryHandlers[H].loaderClass,this.geometryHandlers[H].loaderObject=new a;for(H in this.hierarchyHandlers)a=this.hierarchyHandlers[H].loaderClass,this.hierarchyHandlers[H].loaderObject=new a;F=A=0;z={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},
|
|
|
|
|
+lights:{},fogs:{},empties:{},groups:{}};L.transform&&(H=L.transform.position,a=L.transform.rotation,c=L.transform.scale,H&&z.scene.position.fromArray(H),a&&z.scene.rotation.fromArray(a),c&&z.scene.scale.fromArray(c),H||a||c)&&(z.scene.updateMatrix(),z.scene.updateMatrixWorld());H=function(a){return function(){F-=a;n();s.onLoadComplete()}};for(var J in L.fogs)a=L.fogs[J],"linear"===a.type?w=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(w=new THREE.FogExp2(0,a.density)),a=a.color,w.color.setRGB(a[0],
|
|
|
|
|
+a[1],a[2]),z.fogs[J]=w;for(var y in L.geometries)w=L.geometries[y],w.type in this.geometryHandlers&&(A+=1,s.onLoadStart());for(var N in L.objects)q(L.objects[N],function(a){a.type&&a.type in s.hierarchyHandlers&&(A+=1,s.onLoadStart())});P=A;for(y in L.geometries)if(w=L.geometries[y],"cube"===w.type)t=new THREE.BoxGeometry(w.width,w.height,w.depth,w.widthSegments,w.heightSegments,w.depthSegments),t.name=y,z.geometries[y]=t;else if("plane"===w.type)t=new THREE.PlaneGeometry(w.width,w.height,w.widthSegments,
|
|
|
|
|
+w.heightSegments),t.name=y,z.geometries[y]=t;else if("sphere"===w.type)t=new THREE.SphereGeometry(w.radius,w.widthSegments,w.heightSegments),t.name=y,z.geometries[y]=t;else if("cylinder"===w.type)t=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),t.name=y,z.geometries[y]=t;else if("torus"===w.type)t=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),t.name=y,z.geometries[y]=t;else if("icosahedron"===w.type)t=new THREE.IcosahedronGeometry(w.radius,w.subdivisions),
|
|
|
|
|
+t.name=y,z.geometries[y]=t;else if(w.type in this.geometryHandlers){N={};for(r in w)"type"!==r&&"url"!==r&&(N[r]=w[r]);this.geometryHandlers[w.type].loaderObject.load(d(w.url,L.urlBaseType),h(y),N)}else"embedded"===w.type&&(N=L.embeds[w.id],N.metadata=L.metadata,N&&(N=this.geometryHandlers.ascii.loaderObject.parse(N,""),l(y)(N.geometry,N.materials)));for(var E in L.textures)if(y=L.textures[E],y.url instanceof Array)for(F+=y.url.length,r=0;r<y.url.length;r++)s.onLoadStart();else F+=1,s.onLoadStart();
|
|
|
|
|
+I=F;for(E in L.textures){y=L.textures[E];void 0!==y.mapping&&void 0!==THREE[y.mapping]&&(y.mapping=new THREE[y.mapping]);if(y.url instanceof Array){N=y.url.length;w=[];for(r=0;r<N;r++)w[r]=d(y.url[r],L.urlBaseType);r=(r=/\.dds$/i.test(w[0]))?THREE.ImageUtils.loadCompressedTextureCube(w,y.mapping,H(N)):THREE.ImageUtils.loadTextureCube(w,y.mapping,H(N))}else r=/\.dds$/i.test(y.url),N=d(y.url,L.urlBaseType),w=H(1),r=r?THREE.ImageUtils.loadCompressedTexture(N,y.mapping,w):THREE.ImageUtils.loadTexture(N,
|
|
|
y.mapping,w),void 0!==THREE[y.minFilter]&&(r.minFilter=THREE[y.minFilter]),void 0!==THREE[y.magFilter]&&(r.magFilter=THREE[y.magFilter]),y.anisotropy&&(r.anisotropy=y.anisotropy),y.repeat&&(r.repeat.set(y.repeat[0],y.repeat[1]),1!==y.repeat[0]&&(r.wrapS=THREE.RepeatWrapping),1!==y.repeat[1]&&(r.wrapT=THREE.RepeatWrapping)),y.offset&&r.offset.set(y.offset[0],y.offset[1]),y.wrap&&(N={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==N[y.wrap[0]]&&(r.wrapS=N[y.wrap[0]]),void 0!==
|
|
y.mapping,w),void 0!==THREE[y.minFilter]&&(r.minFilter=THREE[y.minFilter]),void 0!==THREE[y.magFilter]&&(r.magFilter=THREE[y.magFilter]),y.anisotropy&&(r.anisotropy=y.anisotropy),y.repeat&&(r.repeat.set(y.repeat[0],y.repeat[1]),1!==y.repeat[0]&&(r.wrapS=THREE.RepeatWrapping),1!==y.repeat[1]&&(r.wrapT=THREE.RepeatWrapping)),y.offset&&r.offset.set(y.offset[0],y.offset[1]),y.wrap&&(N={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==N[y.wrap[0]]&&(r.wrapS=N[y.wrap[0]]),void 0!==
|
|
|
-N[y.wrap[1]]&&(r.wrapT=N[y.wrap[1]]));C.textures[z]=r}var D,E;for(D in L.materials){z=L.materials[D];for(E in z.parameters)"envMap"===E||"map"===E||"lightMap"===E||"bumpMap"===E?z.parameters[E]=C.textures[z.parameters[E]]:"shading"===E?z.parameters[E]="flat"===z.parameters[E]?THREE.FlatShading:THREE.SmoothShading:"side"===E?z.parameters[E]="double"==z.parameters[E]?THREE.DoubleSide:"back"==z.parameters[E]?THREE.BackSide:THREE.FrontSide:"blending"===E?z.parameters[E]=z.parameters[E]in THREE?THREE[z.parameters[E]]:
|
|
|
|
|
-THREE.NormalBlending:"combine"===E?z.parameters[E]=z.parameters[E]in THREE?THREE[z.parameters[E]]:THREE.MultiplyOperation:"vertexColors"===E?"face"==z.parameters[E]?z.parameters[E]=THREE.FaceColors:z.parameters[E]&&(z.parameters[E]=THREE.VertexColors):"wrapRGB"===E&&(H=z.parameters[E],z.parameters[E]=new THREE.Vector3(H[0],H[1],H[2]));void 0!==z.parameters.opacity&&1>z.parameters.opacity&&(z.parameters.transparent=!0);z.parameters.normalMap?(H=THREE.ShaderLib.normalmap,y=THREE.UniformsUtils.clone(H.uniforms),
|
|
|
|
|
-r=z.parameters.color,N=z.parameters.specular,w=z.parameters.ambient,J=z.parameters.shininess,y.tNormal.value=C.textures[z.parameters.normalMap],z.parameters.normalScale&&y.uNormalScale.value.set(z.parameters.normalScale[0],z.parameters.normalScale[1]),z.parameters.map&&(y.tDiffuse.value=z.parameters.map,y.enableDiffuse.value=!0),z.parameters.envMap&&(y.tCube.value=z.parameters.envMap,y.enableReflection.value=!0,y.reflectivity.value=z.parameters.reflectivity),z.parameters.lightMap&&(y.tAO.value=z.parameters.lightMap,
|
|
|
|
|
-y.enableAO.value=!0),z.parameters.specularMap&&(y.tSpecular.value=C.textures[z.parameters.specularMap],y.enableSpecular.value=!0),z.parameters.displacementMap&&(y.tDisplacement.value=C.textures[z.parameters.displacementMap],y.enableDisplacement.value=!0,y.uDisplacementBias.value=z.parameters.displacementBias,y.uDisplacementScale.value=z.parameters.displacementScale),y.diffuse.value.setHex(r),y.specular.value.setHex(N),y.ambient.value.setHex(w),y.shininess.value=J,z.parameters.opacity&&(y.opacity.value=
|
|
|
|
|
-z.parameters.opacity),p=new THREE.ShaderMaterial({fragmentShader:H.fragmentShader,vertexShader:H.vertexShader,uniforms:y,lights:!0,fog:!0})):p=new THREE[z.type](z.parameters);p.name=D;C.materials[D]=p}for(D in L.materials)if(z=L.materials[D],z.parameters.materials){E=[];for(r=0;r<z.parameters.materials.length;r++)E.push(C.materials[z.parameters.materials[r]]);C.materials[D].materials=E}e();C.cameras&&L.defaults.camera&&(C.currentCamera=C.cameras[L.defaults.camera]);C.fogs&&L.defaults.fog&&(C.scene.fog=
|
|
|
|
|
-C.fogs[L.defaults.fog]);s.callbackSync(C);n()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
|
|
|
|
|
|
|
+N[y.wrap[1]]&&(r.wrapT=N[y.wrap[1]]));z.textures[E]=r}var C,D;for(C in L.materials){E=L.materials[C];for(D in E.parameters)"envMap"===D||"map"===D||"lightMap"===D||"bumpMap"===D?E.parameters[D]=z.textures[E.parameters[D]]:"shading"===D?E.parameters[D]="flat"===E.parameters[D]?THREE.FlatShading:THREE.SmoothShading:"side"===D?E.parameters[D]="double"==E.parameters[D]?THREE.DoubleSide:"back"==E.parameters[D]?THREE.BackSide:THREE.FrontSide:"blending"===D?E.parameters[D]=E.parameters[D]in THREE?THREE[E.parameters[D]]:
|
|
|
|
|
+THREE.NormalBlending:"combine"===D?E.parameters[D]=E.parameters[D]in THREE?THREE[E.parameters[D]]:THREE.MultiplyOperation:"vertexColors"===D?"face"==E.parameters[D]?E.parameters[D]=THREE.FaceColors:E.parameters[D]&&(E.parameters[D]=THREE.VertexColors):"wrapRGB"===D&&(H=E.parameters[D],E.parameters[D]=new THREE.Vector3(H[0],H[1],H[2]));void 0!==E.parameters.opacity&&1>E.parameters.opacity&&(E.parameters.transparent=!0);E.parameters.normalMap?(H=THREE.ShaderLib.normalmap,y=THREE.UniformsUtils.clone(H.uniforms),
|
|
|
|
|
+r=E.parameters.color,N=E.parameters.specular,w=E.parameters.ambient,J=E.parameters.shininess,y.tNormal.value=z.textures[E.parameters.normalMap],E.parameters.normalScale&&y.uNormalScale.value.set(E.parameters.normalScale[0],E.parameters.normalScale[1]),E.parameters.map&&(y.tDiffuse.value=E.parameters.map,y.enableDiffuse.value=!0),E.parameters.envMap&&(y.tCube.value=E.parameters.envMap,y.enableReflection.value=!0,y.reflectivity.value=E.parameters.reflectivity),E.parameters.lightMap&&(y.tAO.value=E.parameters.lightMap,
|
|
|
|
|
+y.enableAO.value=!0),E.parameters.specularMap&&(y.tSpecular.value=z.textures[E.parameters.specularMap],y.enableSpecular.value=!0),E.parameters.displacementMap&&(y.tDisplacement.value=z.textures[E.parameters.displacementMap],y.enableDisplacement.value=!0,y.uDisplacementBias.value=E.parameters.displacementBias,y.uDisplacementScale.value=E.parameters.displacementScale),y.diffuse.value.setHex(r),y.specular.value.setHex(N),y.ambient.value.setHex(w),y.shininess.value=J,E.parameters.opacity&&(y.opacity.value=
|
|
|
|
|
+E.parameters.opacity),p=new THREE.ShaderMaterial({fragmentShader:H.fragmentShader,vertexShader:H.vertexShader,uniforms:y,lights:!0,fog:!0})):p=new THREE[E.type](E.parameters);p.name=C;z.materials[C]=p}for(C in L.materials)if(E=L.materials[C],E.parameters.materials){D=[];for(r=0;r<E.parameters.materials.length;r++)D.push(z.materials[E.parameters.materials[r]]);z.materials[C].materials=D}e();z.cameras&&L.defaults.camera&&(z.currentCamera=z.cameras[L.defaults.camera]);z.fogs&&L.defaults.fog&&(z.scene.fog=
|
|
|
|
|
+z.fogs[L.defaults.fog]);s.callbackSync(z);n()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
|
|
|
THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
|
|
THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
|
|
|
a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
|
|
a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
|
|
|
THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
@@ -307,25 +307,25 @@ THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){va
|
|
|
function c(a,b,c,d){s(b);u(c);t(d);p(a.getStyle());y.stroke();ia.expandByScalar(2*b)}function d(a){v(a.getStyle());y.fill()}function e(a){f(a.target)}function f(a){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ma[a.id]=y.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":!1===b&&!0===c?"repeat-y":"no-repeat")}
|
|
function c(a,b,c,d){s(b);u(c);t(d);p(a.getStyle());y.stroke();ia.expandByScalar(2*b)}function d(a){v(a.getStyle());y.fill()}function e(a){f(a.target)}function f(a){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ma[a.id]=y.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":!1===b&&!0===c?"repeat-y":"no-repeat")}
|
|
|
function g(a,b,c,d,g,h,m,k,l,p,n,q,r){if(!(r instanceof THREE.DataTexture)){!1===r.hasEventListener("update",e)&&(void 0!==r.image&&0<r.image.width&&f(r),r.addEventListener("update",e));var s=Ma[r.id];if(void 0!==s){v(s);var s=r.offset.x/r.repeat.x,u=r.offset.y/r.repeat.y,t=r.image.width*r.repeat.x;r=r.image.height*r.repeat.y;m=(m+s)*t;k=(k+u)*r;c-=a;d-=b;g-=a;h-=b;l=(l+s)*t-m;p=(p+u)*r-k;n=(n+s)*t-m;q=(q+u)*r-k;r=l*q-n*p;0!==r&&(s=1/r,r=(q*c-p*g)*s,p=(q*d-p*h)*s,c=(l*g-n*c)*s,d=(l*h-n*d)*s,a=a-r*
|
|
function g(a,b,c,d,g,h,m,k,l,p,n,q,r){if(!(r instanceof THREE.DataTexture)){!1===r.hasEventListener("update",e)&&(void 0!==r.image&&0<r.image.width&&f(r),r.addEventListener("update",e));var s=Ma[r.id];if(void 0!==s){v(s);var s=r.offset.x/r.repeat.x,u=r.offset.y/r.repeat.y,t=r.image.width*r.repeat.x;r=r.image.height*r.repeat.y;m=(m+s)*t;k=(k+u)*r;c-=a;d-=b;g-=a;h-=b;l=(l+s)*t-m;p=(p+u)*r-k;n=(n+s)*t-m;q=(q+u)*r-k;r=l*q-n*p;0!==r&&(s=1/r,r=(q*c-p*g)*s,p=(q*d-p*h)*s,c=(l*g-n*c)*s,d=(l*h-n*d)*s,a=a-r*
|
|
|
m-c*k,b=b-p*m-d*k,y.save(),y.transform(r,p,c,d,a,b),y.fill(),y.restore())}else v("rgba(0,0,0,1)"),y.fill()}}function h(a,b,c,d,e,f,g,h,m,k,l,p,n){var r,q;r=n.width-1;q=n.height-1;g*=r;h*=q;c-=a;d-=b;e-=a;f-=b;m=m*r-g;k=k*q-h;l=l*r-g;p=p*q-h;q=1/(m*p-l*k);r=(p*c-k*e)*q;k=(p*d-k*f)*q;c=(m*e-l*c)*q;d=(m*f-l*d)*q;a=a-r*g-c*h;b=b-k*g-d*h;y.save();y.transform(r,k,c,d,a,b);y.clip();y.drawImage(n,0,0);y.restore()}function k(a,b,c,d){ta[0]=255*a.r|0;ta[1]=255*a.g|0;ta[2]=255*a.b|0;ta[4]=255*b.r|0;ta[5]=255*
|
|
m-c*k,b=b-p*m-d*k,y.save(),y.transform(r,p,c,d,a,b),y.fill(),y.restore())}else v("rgba(0,0,0,1)"),y.fill()}}function h(a,b,c,d,e,f,g,h,m,k,l,p,n){var r,q;r=n.width-1;q=n.height-1;g*=r;h*=q;c-=a;d-=b;e-=a;f-=b;m=m*r-g;k=k*q-h;l=l*r-g;p=p*q-h;q=1/(m*p-l*k);r=(p*c-k*e)*q;k=(p*d-k*f)*q;c=(m*e-l*c)*q;d=(m*f-l*d)*q;a=a-r*g-c*h;b=b-k*g-d*h;y.save();y.transform(r,k,c,d,a,b);y.clip();y.drawImage(n,0,0);y.restore()}function k(a,b,c,d){ta[0]=255*a.r|0;ta[1]=255*a.g|0;ta[2]=255*a.b|0;ta[4]=255*b.r|0;ta[5]=255*
|
|
|
-b.g|0;ta[6]=255*b.b|0;ta[8]=255*c.r|0;ta[9]=255*c.g|0;ta[10]=255*c.b|0;ta[12]=255*d.r|0;ta[13]=255*d.g|0;ta[14]=255*d.b|0;Sa.putImageData(m,0,0);Oa.drawImage(Pa,0,0);return ab}function l(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function n(a){D!==a&&(D=y.globalAlpha=a)}function q(a){E!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
|
|
|
|
|
-(y.globalCompositeOperation="darker"),E=a)}function s(a){T!==a&&(T=y.lineWidth=a)}function u(a){ea!==a&&(ea=y.lineCap=a)}function t(a){Y!==a&&(Y=y.lineJoin=a)}function p(a){F!==a&&(F=y.strokeStyle=a)}function v(a){X!==a&&(X=y.fillStyle=a)}function w(a,b){if(la!==a||Q!==b)y.setLineDash([a,b]),la=a,Q=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var r=THREE.Math.smoothstep;a=a||{};var x=this,A,G,P,I=new THREE.Projector,C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),B=C.width,L=
|
|
|
|
|
-C.height,H=Math.floor(B/2),J=Math.floor(L/2),y=C.getContext("2d"),N=new THREE.Color(0),z=0,D=1,E=0,F=null,X=null,T=null,ea=null,Y=null,la=null,Q=0,ha,S,M,R;new THREE.RenderableVertex;new THREE.RenderableVertex;var ma,fa,Ka,U,aa,Ca,oa=new THREE.Color,xa=new THREE.Color,va=new THREE.Color,wa=new THREE.Color,Qa=new THREE.Color,Da=new THREE.Color,Xa=new THREE.Color,Za=new THREE.Color,Ma={},Ra,ya,za,ja,Ea,Fa,pa,Aa,Ba,$a,Na=new THREE.Box2,ga=new THREE.Box2,ia=new THREE.Box2,Ga=new THREE.Color,zb=new THREE.Color,
|
|
|
|
|
-ua=new THREE.Color,ba=new THREE.Vector3,Pa,Sa,m,ta,ab,Oa,Ja=16;Pa=document.createElement("canvas");Pa.width=Pa.height=2;Sa=Pa.getContext("2d");Sa.fillStyle="rgba(0,0,0,1)";Sa.fillRect(0,0,2,2);m=Sa.getImageData(0,0,2,2);ta=m.data;ab=document.createElement("canvas");ab.width=ab.height=Ja;Oa=ab.getContext("2d");Oa.translate(-Ja/2,-Ja/2);Oa.scale(Ja,Ja);Ja--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=null!==a[0]?a:null}:function(){});this.domElement=C;this.devicePixelRatio=
|
|
|
|
|
-void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){B=a*this.devicePixelRatio;L=b*this.devicePixelRatio;H=Math.floor(B/2);J=Math.floor(L/2);C.width=B;C.height=L;1!==this.devicePixelRatio&&!1!==c&&(C.style.width=a+"px",C.style.height=b+"px");Na.min.set(-H,
|
|
|
|
|
--J);Na.max.set(H,J);ga.min.set(-H,-J);ga.max.set(H,J);D=1;E=0;Y=ea=T=X=F=null};this.setClearColor=function(a,b){N.set(a);z=void 0!==b?b:1;ga.min.set(-H,-J);ga.max.set(H,J)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,H,J);!1===ga.empty()&&(ga.intersect(Na),ga.expandByScalar(2),1>z&&y.clearRect(ga.min.x|
|
|
|
|
|
-0,ga.min.y|0,ga.max.x-ga.min.x|0,ga.max.y-ga.min.y|0),0<z&&(q(THREE.NormalBlending),n(1),v("rgba("+Math.floor(255*N.r)+","+Math.floor(255*N.g)+","+Math.floor(255*N.b)+","+z+")"),y.fillRect(ga.min.x|0,ga.min.y|0,ga.max.x-ga.min.x|0,ga.max.y-ga.min.y|0)),ga.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,m){if(!1===m instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
|
|
|
|
|
-else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,H,J);x.info.render.vertices=0;x.info.render.faces=0;A=I.projectScene(a,m,this.sortObjects,this.sortElements);G=A.elements;P=A.lights;ha=m;Ga.setRGB(0,0,0);zb.setRGB(0,0,0);ua.setRGB(0,0,0);for(var C=0,L=P.length;C<L;C++){var B=P[C],z=B.color;B instanceof THREE.AmbientLight?Ga.add(z):B instanceof THREE.DirectionalLight?zb.add(z):B instanceof THREE.PointLight&&ua.add(z)}C=0;for(L=G.length;C<L;C++){var E=G[C],D=E.material;if(void 0!==D&&
|
|
|
|
|
-!1!==D.visible){ia.makeEmpty();if(E instanceof THREE.RenderableSprite){S=E;S.x*=H;S.y*=J;B=S;z=D;n(z.opacity);q(z.blending);var N=E.scale.x*H,E=E.scale.y*J,D=0.5*Math.sqrt(N*N+E*E);ia.min.set(B.x-D,B.y-D);ia.max.set(B.x+D,B.y+D);if(!1===Na.isIntersectionBox(ia))ia.makeEmpty();else if(z instanceof THREE.SpriteMaterial||z instanceof THREE.ParticleSystemMaterial){var F=z.map;if(null!==F){!1===F.hasEventListener("update",e)&&(void 0!==F.image&&0<F.image.width&&f(F),F.addEventListener("update",e));D=Ma[F.id];
|
|
|
|
|
-void 0!==D?v(D):v("rgba( 0, 0, 0, 1 )");var Q=F.image,D=Q.width*F.offset.x,T=Q.height*F.offset.y,X=Q.width*F.repeat.x,F=Q.height*F.repeat.y,Q=N/X,Y=E/F;y.save();y.translate(B.x,B.y);0!==z.rotation&&y.rotate(z.rotation);y.translate(-N/2,-E/2);y.scale(Q,Y);y.translate(-D,-T);y.fillRect(D,T,X,F)}else v(z.color.getStyle()),y.save(),y.translate(B.x,B.y),0!==z.rotation&&y.rotate(z.rotation),y.scale(N,-E),y.fillRect(-0.5,-0.5,1,1);y.restore()}else z instanceof THREE.SpriteCanvasMaterial&&(p(z.color.getStyle()),
|
|
|
|
|
-v(z.color.getStyle()),y.save(),y.translate(B.x,B.y),0!==z.rotation&&y.rotate(z.rotation),y.scale(N,E),z.program(y),y.restore())}else if(E instanceof THREE.RenderableLine){if(S=E.v1,M=E.v2,S.positionScreen.x*=H,S.positionScreen.y*=J,M.positionScreen.x*=H,M.positionScreen.y*=J,ia.setFromPoints([S.positionScreen,M.positionScreen]),!0===Na.isIntersectionBox(ia))if(B=S,z=M,N=E,E=D,n(E.opacity),q(E.blending),y.beginPath(),y.moveTo(B.positionScreen.x,B.positionScreen.y),y.lineTo(z.positionScreen.x,z.positionScreen.y),
|
|
|
|
|
-E instanceof THREE.LineBasicMaterial){s(E.linewidth);u(E.linecap);t(E.linejoin);if(E.vertexColors!==THREE.VertexColors)p(E.color.getStyle());else if(D=N.vertexColors[0].getStyle(),N=N.vertexColors[1].getStyle(),D===N)p(D);else{try{var ea=y.createLinearGradient(B.positionScreen.x,B.positionScreen.y,z.positionScreen.x,z.positionScreen.y);ea.addColorStop(0,D);ea.addColorStop(1,N)}catch(la){ea=D}p(ea)}y.stroke();ia.expandByScalar(2*E.linewidth)}else E instanceof THREE.LineDashedMaterial&&(s(E.linewidth),
|
|
|
|
|
-u(E.linecap),t(E.linejoin),p(E.color.getStyle()),w(E.dashSize,E.gapSize),y.stroke(),ia.expandByScalar(2*E.linewidth),w(null,null))}else if(E instanceof THREE.RenderableFace3){S=E.v1;M=E.v2;R=E.v3;if(-1>S.positionScreen.z||1<S.positionScreen.z)continue;if(-1>M.positionScreen.z||1<M.positionScreen.z)continue;if(-1>R.positionScreen.z||1<R.positionScreen.z)continue;S.positionScreen.x*=H;S.positionScreen.y*=J;M.positionScreen.x*=H;M.positionScreen.y*=J;R.positionScreen.x*=H;R.positionScreen.y*=J;0<D.overdraw&&
|
|
|
|
|
-(l(S.positionScreen,M.positionScreen,D.overdraw),l(M.positionScreen,R.positionScreen,D.overdraw),l(R.positionScreen,S.positionScreen,D.overdraw));ia.setFromPoints([S.positionScreen,M.positionScreen,R.positionScreen]);if(!0===Na.isIntersectionBox(ia)){B=S;z=M;N=R;x.info.render.vertices+=3;x.info.render.faces++;n(D.opacity);q(D.blending);ma=B.positionScreen.x;fa=B.positionScreen.y;Ka=z.positionScreen.x;U=z.positionScreen.y;aa=N.positionScreen.x;Ca=N.positionScreen.y;var T=ma,X=fa,F=Ka,Q=U,Y=aa,ta=Ca;
|
|
|
|
|
-y.beginPath();y.moveTo(T,X);y.lineTo(F,Q);y.lineTo(Y,ta);y.closePath();(D instanceof THREE.MeshLambertMaterial||D instanceof THREE.MeshPhongMaterial)&&null===D.map?(Da.copy(D.color),Xa.copy(D.emissive),D.vertexColors===THREE.FaceColors&&Da.multiply(E.color),!1===D.wireframe&&D.shading===THREE.SmoothShading&&3===E.vertexNormalsLength?(xa.copy(Ga),va.copy(Ga),wa.copy(Ga),b(E.v1.positionWorld,E.vertexNormalsModel[0],xa),b(E.v2.positionWorld,E.vertexNormalsModel[1],va),b(E.v3.positionWorld,E.vertexNormalsModel[2],
|
|
|
|
|
-wa),xa.multiply(Da).add(Xa),va.multiply(Da).add(Xa),wa.multiply(Da).add(Xa),Qa.addColors(va,wa).multiplyScalar(0.5),za=k(xa,va,wa,Qa),h(ma,fa,Ka,U,aa,Ca,0,0,1,0,0,1,za)):(oa.copy(Ga),b(E.centroidModel,E.normalModel,oa),oa.multiply(Da).add(Xa),!0===D.wireframe?c(oa,D.wireframeLinewidth,D.wireframeLinecap,D.wireframeLinejoin):d(oa))):D instanceof THREE.MeshBasicMaterial||D instanceof THREE.MeshLambertMaterial||D instanceof THREE.MeshPhongMaterial?null!==D.map?D.map.mapping instanceof THREE.UVMapping&&
|
|
|
|
|
-(ja=E.uvs[0],g(ma,fa,Ka,U,aa,Ca,ja[0].x,ja[0].y,ja[1].x,ja[1].y,ja[2].x,ja[2].y,D.map)):null!==D.envMap?D.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ba.copy(E.vertexNormalsModelView[0]),Ea=0.5*ba.x+0.5,Fa=0.5*ba.y+0.5,ba.copy(E.vertexNormalsModelView[1]),pa=0.5*ba.x+0.5,Aa=0.5*ba.y+0.5,ba.copy(E.vertexNormalsModelView[2]),Ba=0.5*ba.x+0.5,$a=0.5*ba.y+0.5,g(ma,fa,Ka,U,aa,Ca,Ea,Fa,pa,Aa,Ba,$a,D.envMap)):(oa.copy(D.color),D.vertexColors===THREE.FaceColors&&oa.multiply(E.color),!0===
|
|
|
|
|
-D.wireframe?c(oa,D.wireframeLinewidth,D.wireframeLinecap,D.wireframeLinejoin):d(oa)):D instanceof THREE.MeshDepthMaterial?(Ra=ha.near,ya=ha.far,xa.r=xa.g=xa.b=1-r(B.positionScreen.z*B.positionScreen.w,Ra,ya),va.r=va.g=va.b=1-r(z.positionScreen.z*z.positionScreen.w,Ra,ya),wa.r=wa.g=wa.b=1-r(N.positionScreen.z*N.positionScreen.w,Ra,ya),Qa.addColors(va,wa).multiplyScalar(0.5),za=k(xa,va,wa,Qa),h(ma,fa,Ka,U,aa,Ca,0,0,1,0,0,1,za)):D instanceof THREE.MeshNormalMaterial&&(B=void 0,D.shading===THREE.FlatShading?
|
|
|
|
|
-(B=E.normalModelView,oa.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),!0===D.wireframe?c(oa,D.wireframeLinewidth,D.wireframeLinecap,D.wireframeLinejoin):d(oa)):D.shading===THREE.SmoothShading&&(B=E.vertexNormalsModelView[0],xa.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=E.vertexNormalsModelView[1],va.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=E.vertexNormalsModelView[2],wa.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),Qa.addColors(va,wa).multiplyScalar(0.5),
|
|
|
|
|
|
|
+b.g|0;ta[6]=255*b.b|0;ta[8]=255*c.r|0;ta[9]=255*c.g|0;ta[10]=255*c.b|0;ta[12]=255*d.r|0;ta[13]=255*d.g|0;ta[14]=255*d.b|0;Sa.putImageData(m,0,0);Oa.drawImage(Pa,0,0);return ab}function l(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function n(a){C!==a&&(C=y.globalAlpha=a)}function q(a){D!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
|
|
|
|
|
+(y.globalCompositeOperation="darker"),D=a)}function s(a){T!==a&&(T=y.lineWidth=a)}function u(a){ea!==a&&(ea=y.lineCap=a)}function t(a){Y!==a&&(Y=y.lineJoin=a)}function p(a){G!==a&&(G=y.strokeStyle=a)}function v(a){X!==a&&(X=y.fillStyle=a)}function w(a,b){if(la!==a||Q!==b)y.setLineDash([a,b]),la=a,Q=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var r=THREE.Math.smoothstep;a=a||{};var x=this,A,F,P,I=new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),B=z.width,L=
|
|
|
|
|
+z.height,H=Math.floor(B/2),J=Math.floor(L/2),y=z.getContext("2d"),N=new THREE.Color(0),E=0,C=1,D=0,G=null,X=null,T=null,ea=null,Y=null,la=null,Q=0,ha,S,M,R;new THREE.RenderableVertex;new THREE.RenderableVertex;var ma,fa,Ka,U,aa,Ca,oa=new THREE.Color,xa=new THREE.Color,va=new THREE.Color,wa=new THREE.Color,Qa=new THREE.Color,Da=new THREE.Color,Xa=new THREE.Color,Za=new THREE.Color,Ma={},Ra,ya,za,ja,Ea,Fa,pa,Aa,Ba,$a,Na=new THREE.Box2,ga=new THREE.Box2,ia=new THREE.Box2,Ga=new THREE.Color,zb=new THREE.Color,
|
|
|
|
|
+ua=new THREE.Color,ba=new THREE.Vector3,Pa,Sa,m,ta,ab,Oa,Ja=16;Pa=document.createElement("canvas");Pa.width=Pa.height=2;Sa=Pa.getContext("2d");Sa.fillStyle="rgba(0,0,0,1)";Sa.fillRect(0,0,2,2);m=Sa.getImageData(0,0,2,2);ta=m.data;ab=document.createElement("canvas");ab.width=ab.height=Ja;Oa=ab.getContext("2d");Oa.translate(-Ja/2,-Ja/2);Oa.scale(Ja,Ja);Ja--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=null!==a[0]?a:null}:function(){});this.domElement=z;this.devicePixelRatio=
|
|
|
|
|
+void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){B=a*this.devicePixelRatio;L=b*this.devicePixelRatio;H=Math.floor(B/2);J=Math.floor(L/2);z.width=B;z.height=L;1!==this.devicePixelRatio&&!1!==c&&(z.style.width=a+"px",z.style.height=b+"px");Na.min.set(-H,
|
|
|
|
|
+-J);Na.max.set(H,J);ga.min.set(-H,-J);ga.max.set(H,J);C=1;D=0;Y=ea=T=X=G=null};this.setClearColor=function(a,b){N.set(a);E=void 0!==b?b:1;ga.min.set(-H,-J);ga.max.set(H,J)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,H,J);!1===ga.empty()&&(ga.intersect(Na),ga.expandByScalar(2),1>E&&y.clearRect(ga.min.x|
|
|
|
|
|
+0,ga.min.y|0,ga.max.x-ga.min.x|0,ga.max.y-ga.min.y|0),0<E&&(q(THREE.NormalBlending),n(1),v("rgba("+Math.floor(255*N.r)+","+Math.floor(255*N.g)+","+Math.floor(255*N.b)+","+E+")"),y.fillRect(ga.min.x|0,ga.min.y|0,ga.max.x-ga.min.x|0,ga.max.y-ga.min.y|0)),ga.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,m){if(!1===m instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
|
|
|
|
|
+else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,H,J);x.info.render.vertices=0;x.info.render.faces=0;A=I.projectScene(a,m,this.sortObjects,this.sortElements);F=A.elements;P=A.lights;ha=m;Ga.setRGB(0,0,0);zb.setRGB(0,0,0);ua.setRGB(0,0,0);for(var z=0,L=P.length;z<L;z++){var B=P[z],E=B.color;B instanceof THREE.AmbientLight?Ga.add(E):B instanceof THREE.DirectionalLight?zb.add(E):B instanceof THREE.PointLight&&ua.add(E)}z=0;for(L=F.length;z<L;z++){var D=F[z],C=D.material;if(void 0!==C&&
|
|
|
|
|
+!1!==C.visible){ia.makeEmpty();if(D instanceof THREE.RenderableSprite){S=D;S.x*=H;S.y*=J;B=S;E=C;n(E.opacity);q(E.blending);var N=D.scale.x*H,D=D.scale.y*J,C=0.5*Math.sqrt(N*N+D*D);ia.min.set(B.x-C,B.y-C);ia.max.set(B.x+C,B.y+C);if(!1===Na.isIntersectionBox(ia))ia.makeEmpty();else if(E instanceof THREE.SpriteMaterial||E instanceof THREE.ParticleSystemMaterial){var G=E.map;if(null!==G){!1===G.hasEventListener("update",e)&&(void 0!==G.image&&0<G.image.width&&f(G),G.addEventListener("update",e));C=Ma[G.id];
|
|
|
|
|
+void 0!==C?v(C):v("rgba( 0, 0, 0, 1 )");var Q=G.image,C=Q.width*G.offset.x,T=Q.height*G.offset.y,X=Q.width*G.repeat.x,G=Q.height*G.repeat.y,Q=N/X,Y=D/G;y.save();y.translate(B.x,B.y);0!==E.rotation&&y.rotate(E.rotation);y.translate(-N/2,-D/2);y.scale(Q,Y);y.translate(-C,-T);y.fillRect(C,T,X,G)}else v(E.color.getStyle()),y.save(),y.translate(B.x,B.y),0!==E.rotation&&y.rotate(E.rotation),y.scale(N,-D),y.fillRect(-0.5,-0.5,1,1);y.restore()}else E instanceof THREE.SpriteCanvasMaterial&&(p(E.color.getStyle()),
|
|
|
|
|
+v(E.color.getStyle()),y.save(),y.translate(B.x,B.y),0!==E.rotation&&y.rotate(E.rotation),y.scale(N,D),E.program(y),y.restore())}else if(D instanceof THREE.RenderableLine){if(S=D.v1,M=D.v2,S.positionScreen.x*=H,S.positionScreen.y*=J,M.positionScreen.x*=H,M.positionScreen.y*=J,ia.setFromPoints([S.positionScreen,M.positionScreen]),!0===Na.isIntersectionBox(ia))if(B=S,E=M,N=D,D=C,n(D.opacity),q(D.blending),y.beginPath(),y.moveTo(B.positionScreen.x,B.positionScreen.y),y.lineTo(E.positionScreen.x,E.positionScreen.y),
|
|
|
|
|
+D instanceof THREE.LineBasicMaterial){s(D.linewidth);u(D.linecap);t(D.linejoin);if(D.vertexColors!==THREE.VertexColors)p(D.color.getStyle());else if(C=N.vertexColors[0].getStyle(),N=N.vertexColors[1].getStyle(),C===N)p(C);else{try{var ea=y.createLinearGradient(B.positionScreen.x,B.positionScreen.y,E.positionScreen.x,E.positionScreen.y);ea.addColorStop(0,C);ea.addColorStop(1,N)}catch(la){ea=C}p(ea)}y.stroke();ia.expandByScalar(2*D.linewidth)}else D instanceof THREE.LineDashedMaterial&&(s(D.linewidth),
|
|
|
|
|
+u(D.linecap),t(D.linejoin),p(D.color.getStyle()),w(D.dashSize,D.gapSize),y.stroke(),ia.expandByScalar(2*D.linewidth),w(null,null))}else if(D instanceof THREE.RenderableFace3){S=D.v1;M=D.v2;R=D.v3;if(-1>S.positionScreen.z||1<S.positionScreen.z)continue;if(-1>M.positionScreen.z||1<M.positionScreen.z)continue;if(-1>R.positionScreen.z||1<R.positionScreen.z)continue;S.positionScreen.x*=H;S.positionScreen.y*=J;M.positionScreen.x*=H;M.positionScreen.y*=J;R.positionScreen.x*=H;R.positionScreen.y*=J;0<C.overdraw&&
|
|
|
|
|
+(l(S.positionScreen,M.positionScreen,C.overdraw),l(M.positionScreen,R.positionScreen,C.overdraw),l(R.positionScreen,S.positionScreen,C.overdraw));ia.setFromPoints([S.positionScreen,M.positionScreen,R.positionScreen]);if(!0===Na.isIntersectionBox(ia)){B=S;E=M;N=R;x.info.render.vertices+=3;x.info.render.faces++;n(C.opacity);q(C.blending);ma=B.positionScreen.x;fa=B.positionScreen.y;Ka=E.positionScreen.x;U=E.positionScreen.y;aa=N.positionScreen.x;Ca=N.positionScreen.y;var T=ma,X=fa,G=Ka,Q=U,Y=aa,ta=Ca;
|
|
|
|
|
+y.beginPath();y.moveTo(T,X);y.lineTo(G,Q);y.lineTo(Y,ta);y.closePath();(C instanceof THREE.MeshLambertMaterial||C instanceof THREE.MeshPhongMaterial)&&null===C.map?(Da.copy(C.color),Xa.copy(C.emissive),C.vertexColors===THREE.FaceColors&&Da.multiply(D.color),!1===C.wireframe&&C.shading===THREE.SmoothShading&&3===D.vertexNormalsLength?(xa.copy(Ga),va.copy(Ga),wa.copy(Ga),b(D.v1.positionWorld,D.vertexNormalsModel[0],xa),b(D.v2.positionWorld,D.vertexNormalsModel[1],va),b(D.v3.positionWorld,D.vertexNormalsModel[2],
|
|
|
|
|
+wa),xa.multiply(Da).add(Xa),va.multiply(Da).add(Xa),wa.multiply(Da).add(Xa),Qa.addColors(va,wa).multiplyScalar(0.5),za=k(xa,va,wa,Qa),h(ma,fa,Ka,U,aa,Ca,0,0,1,0,0,1,za)):(oa.copy(Ga),b(D.centroidModel,D.normalModel,oa),oa.multiply(Da).add(Xa),!0===C.wireframe?c(oa,C.wireframeLinewidth,C.wireframeLinecap,C.wireframeLinejoin):d(oa))):C instanceof THREE.MeshBasicMaterial||C instanceof THREE.MeshLambertMaterial||C instanceof THREE.MeshPhongMaterial?null!==C.map?C.map.mapping instanceof THREE.UVMapping&&
|
|
|
|
|
+(ja=D.uvs[0],g(ma,fa,Ka,U,aa,Ca,ja[0].x,ja[0].y,ja[1].x,ja[1].y,ja[2].x,ja[2].y,C.map)):null!==C.envMap?C.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ba.copy(D.vertexNormalsModelView[0]),Ea=0.5*ba.x+0.5,Fa=0.5*ba.y+0.5,ba.copy(D.vertexNormalsModelView[1]),pa=0.5*ba.x+0.5,Aa=0.5*ba.y+0.5,ba.copy(D.vertexNormalsModelView[2]),Ba=0.5*ba.x+0.5,$a=0.5*ba.y+0.5,g(ma,fa,Ka,U,aa,Ca,Ea,Fa,pa,Aa,Ba,$a,C.envMap)):(oa.copy(C.color),C.vertexColors===THREE.FaceColors&&oa.multiply(D.color),!0===
|
|
|
|
|
+C.wireframe?c(oa,C.wireframeLinewidth,C.wireframeLinecap,C.wireframeLinejoin):d(oa)):C instanceof THREE.MeshDepthMaterial?(Ra=ha.near,ya=ha.far,xa.r=xa.g=xa.b=1-r(B.positionScreen.z*B.positionScreen.w,Ra,ya),va.r=va.g=va.b=1-r(E.positionScreen.z*E.positionScreen.w,Ra,ya),wa.r=wa.g=wa.b=1-r(N.positionScreen.z*N.positionScreen.w,Ra,ya),Qa.addColors(va,wa).multiplyScalar(0.5),za=k(xa,va,wa,Qa),h(ma,fa,Ka,U,aa,Ca,0,0,1,0,0,1,za)):C instanceof THREE.MeshNormalMaterial&&(B=void 0,C.shading===THREE.FlatShading?
|
|
|
|
|
+(B=D.normalModelView,oa.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),!0===C.wireframe?c(oa,C.wireframeLinewidth,C.wireframeLinecap,C.wireframeLinejoin):d(oa)):C.shading===THREE.SmoothShading&&(B=D.vertexNormalsModelView[0],xa.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=D.vertexNormalsModelView[1],va.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=D.vertexNormalsModelView[2],wa.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),Qa.addColors(va,wa).multiplyScalar(0.5),
|
|
|
za=k(xa,va,wa,Qa),h(ma,fa,Ka,U,aa,Ca,0,0,1,0,0,1,za)))}}ga.union(ia)}}y.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
za=k(xa,va,wa,Qa),h(ma,fa,Ka,U,aa,Ca,0,0,1,0,0,1,za)))}}ga.union(ia)}}y.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
@@ -387,46 +387,46 @@ s;l++)k.__webglMorphNormalsBuffers.push(m.createBuffer());M.info.memory.geometri
|
|
|
new Float32Array(3*k),h.__colorArray=new Float32Array(3*k),h.__lineDistanceArray=new Float32Array(1*k),h.__webglLineCount=k,b(h,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&!f.__webglVertexBuffer&&(h=f,h.__webglVertexBuffer=m.createBuffer(),h.__webglColorBuffer=m.createBuffer(),M.info.memory.geometries++,h=f,k=h.vertices.length,h.__vertexArray=new Float32Array(3*k),h.__colorArray=new Float32Array(3*k),h.__sortArray=[],h.__webglParticleCount=
|
|
new Float32Array(3*k),h.__colorArray=new Float32Array(3*k),h.__lineDistanceArray=new Float32Array(1*k),h.__webglLineCount=k,b(h,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&!f.__webglVertexBuffer&&(h=f,h.__webglVertexBuffer=m.createBuffer(),h.__webglColorBuffer=m.createBuffer(),M.info.memory.geometries++,h=f,k=h.vertices.length,h.__vertexArray=new Float32Array(3*k),h.__colorArray=new Float32Array(3*k),h.__sortArray=[],h.__webglParticleCount=
|
|
|
k,b(h,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)p(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)h=f.geometryGroups[e],p(d.__webglObjects,h,a)}else a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,p(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,
|
|
k,b(h,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)p(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)h=f.geometryGroups[e],p(d.__webglObjects,h,a)}else a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,p(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,
|
|
|
object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function p(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function w(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function r(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof
|
|
object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function p(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function w(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function r(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof
|
|
|
-THREE.Line?x(b.__webglObjects,a):a instanceof THREE.Sprite?A(b.__webglSprites,a):a instanceof THREE.LensFlare?A(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&x(b.__webglObjectsImmediate,a);delete a.__webglActive}function x(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function A(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function G(a,b,c,d,e){xa=0;d.needsUpdate&&(d.program&&Eb(d),M.initMaterial(d,b,c,e),d.needsUpdate=
|
|
|
|
|
|
|
+THREE.Line?x(b.__webglObjects,a):a instanceof THREE.Sprite?A(b.__webglSprites,a):a instanceof THREE.LensFlare?A(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&x(b.__webglObjectsImmediate,a);delete a.__webglActive}function x(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function A(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function F(a,b,c,d,e){xa=0;d.needsUpdate&&(d.program&&Eb(d),M.initMaterial(d,b,c,e),d.needsUpdate=
|
|
|
!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g!==fa&&(m.useProgram(g),fa=g,f=!0);d.id!==U&&(U=d.id,f=!0);if(f||a!==Ca)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==Ca&&(Ca=a);if(d.skinning)if(yb&&e.useVertexTexture){if(null!==h.boneTexture){var l=P();m.uniform1i(h.boneTexture,l);M.setTexture(e.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,
|
|
!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g!==fa&&(m.useProgram(g),fa=g,f=!0);d.id!==U&&(U=d.id,f=!0);if(f||a!==Ca)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==Ca&&(Ca=a);if(d.skinning)if(yb&&e.useVertexTexture){if(null!==h.boneTexture){var l=P();m.uniform1i(h.boneTexture,l);M.setTexture(e.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,
|
|
|
e.boneTextureWidth);null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){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.lights){if(Pa){var p,n=l=0,r=0,q,s,u,t=Sa,v=t.directional.colors,
|
|
e.boneTextureWidth);null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){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.lights){if(Pa){var p,n=l=0,r=0,q,s,u,t=Sa,v=t.directional.colors,
|
|
|
-w=t.directional.positions,x=t.point.colors,A=t.point.positions,B=t.point.distances,z=t.spot.colors,G=t.spot.positions,L=t.spot.distances,H=t.spot.directions,N=t.spot.anglesCos,R=t.spot.exponents,F=t.hemi.skyColors,Q=t.hemi.groundColors,J=t.hemi.positions,T=0,X=0,S=0,ma=0,oa=0,cc=0,$=0,Z=0,Y=p=0;c=u=Y=0;for(f=b.length;c<f;c++)if(p=b[c],!p.onlyShadow)if(q=p.color,s=p.intensity,u=p.distance,p instanceof THREE.AmbientLight)p.visible&&(M.gammaInput?(l+=q.r*q.r,n+=q.g*q.g,r+=q.b*q.b):(l+=q.r,n+=q.g,r+=
|
|
|
|
|
-q.b));else if(p instanceof THREE.DirectionalLight){if(oa+=1,p.visible&&(ba.setFromMatrixPosition(p.matrixWorld),ua.setFromMatrixPosition(p.target.matrixWorld),ba.sub(ua),ba.normalize(),0!==ba.x||0!==ba.y||0!==ba.z))p=3*T,w[p]=ba.x,w[p+1]=ba.y,w[p+2]=ba.z,M.gammaInput?I(v,p,q,s*s):C(v,p,q,s),T+=1}else p instanceof THREE.PointLight?(cc+=1,p.visible&&(Y=3*X,M.gammaInput?I(x,Y,q,s*s):C(x,Y,q,s),ua.setFromMatrixPosition(p.matrixWorld),A[Y]=ua.x,A[Y+1]=ua.y,A[Y+2]=ua.z,B[X]=u,X+=1)):p instanceof THREE.SpotLight?
|
|
|
|
|
-($+=1,p.visible&&(Y=3*S,M.gammaInput?I(z,Y,q,s*s):C(z,Y,q,s),ua.setFromMatrixPosition(p.matrixWorld),G[Y]=ua.x,G[Y+1]=ua.y,G[Y+2]=ua.z,L[S]=u,ba.copy(ua),ua.setFromMatrixPosition(p.target.matrixWorld),ba.sub(ua),ba.normalize(),H[Y]=ba.x,H[Y+1]=ba.y,H[Y+2]=ba.z,N[S]=Math.cos(p.angle),R[S]=p.exponent,S+=1)):p instanceof THREE.HemisphereLight&&(Z+=1,p.visible&&(ba.setFromMatrixPosition(p.matrixWorld),ba.normalize(),0!==ba.x||0!==ba.y||0!==ba.z))&&(u=3*ma,J[u]=ba.x,J[u+1]=ba.y,J[u+2]=ba.z,q=p.color,p=
|
|
|
|
|
-p.groundColor,M.gammaInput?(s*=s,I(F,u,q,s),I(Q,u,p,s)):(C(F,u,q,s),C(Q,u,p,s)),ma+=1);c=3*T;for(f=Math.max(v.length,3*oa);c<f;c++)v[c]=0;c=3*X;for(f=Math.max(x.length,3*cc);c<f;c++)x[c]=0;c=3*S;for(f=Math.max(z.length,3*$);c<f;c++)z[c]=0;c=3*ma;for(f=Math.max(F.length,3*Z);c<f;c++)F[c]=0;c=3*ma;for(f=Math.max(Q.length,3*Z);c<f;c++)Q[c]=0;t.directional.length=T;t.point.length=X;t.spot.length=S;t.hemi.length=ma;t.ambient[0]=l;t.ambient[1]=n;t.ambient[2]=r;Pa=!1}c=Sa;k.ambientLightColor.value=c.ambient;
|
|
|
|
|
|
|
+w=t.directional.positions,x=t.point.colors,A=t.point.positions,B=t.point.distances,E=t.spot.colors,F=t.spot.positions,L=t.spot.distances,H=t.spot.directions,N=t.spot.anglesCos,G=t.spot.exponents,R=t.hemi.skyColors,Q=t.hemi.groundColors,J=t.hemi.positions,T=0,X=0,S=0,ma=0,oa=0,cc=0,$=0,Z=0,Y=p=0;c=u=Y=0;for(f=b.length;c<f;c++)if(p=b[c],!p.onlyShadow)if(q=p.color,s=p.intensity,u=p.distance,p instanceof THREE.AmbientLight)p.visible&&(M.gammaInput?(l+=q.r*q.r,n+=q.g*q.g,r+=q.b*q.b):(l+=q.r,n+=q.g,r+=
|
|
|
|
|
+q.b));else if(p instanceof THREE.DirectionalLight){if(oa+=1,p.visible&&(ba.setFromMatrixPosition(p.matrixWorld),ua.setFromMatrixPosition(p.target.matrixWorld),ba.sub(ua),ba.normalize(),0!==ba.x||0!==ba.y||0!==ba.z))p=3*T,w[p]=ba.x,w[p+1]=ba.y,w[p+2]=ba.z,M.gammaInput?I(v,p,q,s*s):z(v,p,q,s),T+=1}else p instanceof THREE.PointLight?(cc+=1,p.visible&&(Y=3*X,M.gammaInput?I(x,Y,q,s*s):z(x,Y,q,s),ua.setFromMatrixPosition(p.matrixWorld),A[Y]=ua.x,A[Y+1]=ua.y,A[Y+2]=ua.z,B[X]=u,X+=1)):p instanceof THREE.SpotLight?
|
|
|
|
|
+($+=1,p.visible&&(Y=3*S,M.gammaInput?I(E,Y,q,s*s):z(E,Y,q,s),ua.setFromMatrixPosition(p.matrixWorld),F[Y]=ua.x,F[Y+1]=ua.y,F[Y+2]=ua.z,L[S]=u,ba.copy(ua),ua.setFromMatrixPosition(p.target.matrixWorld),ba.sub(ua),ba.normalize(),H[Y]=ba.x,H[Y+1]=ba.y,H[Y+2]=ba.z,N[S]=Math.cos(p.angle),G[S]=p.exponent,S+=1)):p instanceof THREE.HemisphereLight&&(Z+=1,p.visible&&(ba.setFromMatrixPosition(p.matrixWorld),ba.normalize(),0!==ba.x||0!==ba.y||0!==ba.z))&&(u=3*ma,J[u]=ba.x,J[u+1]=ba.y,J[u+2]=ba.z,q=p.color,p=
|
|
|
|
|
+p.groundColor,M.gammaInput?(s*=s,I(R,u,q,s),I(Q,u,p,s)):(z(R,u,q,s),z(Q,u,p,s)),ma+=1);c=3*T;for(f=Math.max(v.length,3*oa);c<f;c++)v[c]=0;c=3*X;for(f=Math.max(x.length,3*cc);c<f;c++)x[c]=0;c=3*S;for(f=Math.max(E.length,3*$);c<f;c++)E[c]=0;c=3*ma;for(f=Math.max(R.length,3*Z);c<f;c++)R[c]=0;c=3*ma;for(f=Math.max(Q.length,3*Z);c<f;c++)Q[c]=0;t.directional.length=T;t.point.length=X;t.spot.length=S;t.hemi.length=ma;t.ambient[0]=l;t.ambient[1]=n;t.ambient[2]=r;Pa=!1}c=Sa;k.ambientLightColor.value=c.ambient;
|
|
|
k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=
|
|
k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=
|
|
|
c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;M.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&
|
|
c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;M.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;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));var aa;d.map?aa=d.map:d.specularMap?aa=d.specularMap:d.normalMap?aa=d.normalMap:d.bumpMap&&(aa=d.bumpMap);void 0!==aa&&(c=aa.offset,aa=aa.repeat,k.offsetRepeat.value.set(c.x,c.y,aa.x,aa.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;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof
|
|
(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale));var aa;d.map?aa=d.map:d.specularMap?aa=d.specularMap:d.normalMap?aa=d.normalMap:d.bumpMap&&(aa=d.bumpMap);void 0!==aa&&(c=aa.offset,aa=aa.repeat,k.offsetRepeat.value.set(c.x,c.y,aa.x,aa.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;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof
|
|
|
-THREE.CubeRefractionMapping}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.ParticleSystemMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=E.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=
|
|
|
|
|
|
|
+THREE.CubeRefractionMapping}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.ParticleSystemMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=D.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=
|
|
|
d.shininess,M.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(M.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&
|
|
d.shininess,M.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(M.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&
|
|
|
k.wrapRGB.value.copy(d.wrapRGB)):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(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(c=aa=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[aa]=l.shadowMap,k.shadowMapSize.value[aa]=l.shadowMapSize,k.shadowMatrix.value[aa]=l.shadowMatrix,
|
|
k.wrapRGB.value.copy(d.wrapRGB)):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(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(c=aa=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[aa]=l.shadowMap,k.shadowMapSize.value[aa]=l.shadowMapSize,k.shadowMatrix.value[aa]=l.shadowMatrix,
|
|
|
k.shadowDarkness.value[aa]=l.shadowDarkness,k.shadowBias.value[aa]=l.shadowBias,aa++);b=d.uniformsList;k=0;for(aa=b.length;k<aa;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],n=c.type,l=c.value,"i"===n)m.uniform1i(f,l);else if("f"===n)m.uniform1f(f,l);else if("v2"===n)m.uniform2f(f,l.x,l.y);else if("v3"===n)m.uniform3f(f,l.x,l.y,l.z);else if("v4"===n)m.uniform4f(f,l.x,l.y,l.z,l.w);else if("c"===n)m.uniform3f(f,l.r,l.g,l.b);else if("iv1"===n)m.uniform1iv(f,l);else if("iv"===n)m.uniform3iv(f,l);else if("fv1"===
|
|
k.shadowDarkness.value[aa]=l.shadowDarkness,k.shadowBias.value[aa]=l.shadowBias,aa++);b=d.uniformsList;k=0;for(aa=b.length;k<aa;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],n=c.type,l=c.value,"i"===n)m.uniform1i(f,l);else if("f"===n)m.uniform1f(f,l);else if("v2"===n)m.uniform2f(f,l.x,l.y);else if("v3"===n)m.uniform3f(f,l.x,l.y,l.z);else if("v4"===n)m.uniform4f(f,l.x,l.y,l.z,l.w);else if("c"===n)m.uniform3f(f,l.r,l.g,l.b);else if("iv1"===n)m.uniform1iv(f,l);else if("iv"===n)m.uniform3iv(f,l);else if("fv1"===
|
|
|
n)m.uniform1fv(f,l);else if("fv"===n)m.uniform3fv(f,l);else if("v2v"===n){void 0===c._array&&(c._array=new Float32Array(2*l.length));n=0;for(r=l.length;n<r;n++)t=2*n,c._array[t]=l[n].x,c._array[t+1]=l[n].y;m.uniform2fv(f,c._array)}else if("v3v"===n){void 0===c._array&&(c._array=new Float32Array(3*l.length));n=0;for(r=l.length;n<r;n++)t=3*n,c._array[t]=l[n].x,c._array[t+1]=l[n].y,c._array[t+2]=l[n].z;m.uniform3fv(f,c._array)}else if("v4v"===n){void 0===c._array&&(c._array=new Float32Array(4*l.length));
|
|
n)m.uniform1fv(f,l);else if("fv"===n)m.uniform3fv(f,l);else if("v2v"===n){void 0===c._array&&(c._array=new Float32Array(2*l.length));n=0;for(r=l.length;n<r;n++)t=2*n,c._array[t]=l[n].x,c._array[t+1]=l[n].y;m.uniform2fv(f,c._array)}else if("v3v"===n){void 0===c._array&&(c._array=new Float32Array(3*l.length));n=0;for(r=l.length;n<r;n++)t=3*n,c._array[t]=l[n].x,c._array[t+1]=l[n].y,c._array[t+2]=l[n].z;m.uniform3fv(f,c._array)}else if("v4v"===n){void 0===c._array&&(c._array=new Float32Array(4*l.length));
|
|
|
n=0;for(r=l.length;n<r;n++)t=4*n,c._array[t]=l[n].x,c._array[t+1]=l[n].y,c._array[t+2]=l[n].z,c._array[t+3]=l[n].w;m.uniform4fv(f,c._array)}else if("m4"===n)void 0===c._array&&(c._array=new Float32Array(16)),l.flattenToArray(c._array),m.uniformMatrix4fv(f,!1,c._array);else if("m4v"===n){void 0===c._array&&(c._array=new Float32Array(16*l.length));n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,16*n);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===n){if(t=l,l=P(),m.uniform1i(f,l),t)if(t.image instanceof
|
|
n=0;for(r=l.length;n<r;n++)t=4*n,c._array[t]=l[n].x,c._array[t+1]=l[n].y,c._array[t+2]=l[n].z,c._array[t+3]=l[n].w;m.uniform4fv(f,c._array)}else if("m4"===n)void 0===c._array&&(c._array=new Float32Array(16)),l.flattenToArray(c._array),m.uniformMatrix4fv(f,!1,c._array);else if("m4v"===n){void 0===c._array&&(c._array=new Float32Array(16*l.length));n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,16*n);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===n){if(t=l,l=P(),m.uniform1i(f,l),t)if(t.image instanceof
|
|
|
Array&&6===t.image.length){if(c=t,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",tb),c.image.__webglTextureCube=m.createTexture(),M.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(n=0;6>n;n++)M.autoScaleCubemaps&&!f?(r=l,t=n,v=c.image[n],x=Zb,v.width<=x&&v.height<=x||(A=Math.max(v.width,v.height),
|
|
Array&&6===t.image.length){if(c=t,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",tb),c.image.__webglTextureCube=m.createTexture(),M.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(n=0;6>n;n++)M.autoScaleCubemaps&&!f?(r=l,t=n,v=c.image[n],x=Zb,v.width<=x&&v.height<=x||(A=Math.max(v.width,v.height),
|
|
|
-w=Math.floor(v.width*x/A),x=Math.floor(v.height*x/A),A=document.createElement("canvas"),A.width=w,A.height=x,A.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=A),r[t]=v):l[n]=c.image[n];n=l[0];r=THREE.Math.isPowerOfTwo(n.width)&&THREE.Math.isPowerOfTwo(n.height);t=D(c.format);v=D(c.type);y(m.TEXTURE_CUBE_MAP,c,r);for(n=0;6>n;n++)if(f)for(x=l[n].mipmaps,A=0,B=x.length;A<B;A++)w=x[A],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,A,t,w.width,w.height,
|
|
|
|
|
|
|
+w=Math.floor(v.width*x/A),x=Math.floor(v.height*x/A),A=document.createElement("canvas"),A.width=w,A.height=x,A.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=A),r[t]=v):l[n]=c.image[n];n=l[0];r=THREE.Math.isPowerOfTwo(n.width)&&THREE.Math.isPowerOfTwo(n.height);t=C(c.format);v=C(c.type);y(m.TEXTURE_CUBE_MAP,c,r);for(n=0;6>n;n++)if(f)for(x=l[n].mipmaps,A=0,B=x.length;A<B;A++)w=x[A],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,A,t,w.width,w.height,
|
|
|
0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,A,t,w.width,w.height,0,t,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t,t,v,l[n]);c.generateMipmaps&&r&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else t instanceof THREE.WebGLRenderTargetCube?(c=t,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):M.setTexture(t,
|
|
0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,A,t,w.width,w.height,0,t,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t,t,v,l[n]);c.generateMipmaps&&r&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else t instanceof THREE.WebGLRenderTargetCube?(c=t,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):M.setTexture(t,
|
|
|
l)}else if("tv"===n){void 0===c._array&&(c._array=[]);n=0;for(r=c.value.length;n<r;n++)c._array[n]=P();m.uniform1iv(f,c._array);n=0;for(r=c.value.length;n<r;n++)t=c.value[n],l=c._array[n],t&&M.setTexture(t,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+n);(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&(ua.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,ua.x,ua.y,ua.z));(d instanceof THREE.MeshPhongMaterial||
|
|
l)}else if("tv"===n){void 0===c._array&&(c._array=[]);n=0;for(r=c.value.length;n<r;n++)c._array[n]=P();m.uniform1iv(f,c._array);n=0;for(r=c.value.length;n<r;n++)t=c.value[n],l=c._array[n],t&&M.setTexture(t,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+n);(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&(ua.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,ua.x,ua.y,ua.z));(d instanceof THREE.MeshPhongMaterial||
|
|
|
d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&m.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}m.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&m.uniformMatrix3fv(h.normalMatrix,!1,e._normalMatrix.elements);null!==h.modelMatrix&&m.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function P(){var a=xa;a>=Jb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+
|
|
d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&m.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}m.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&m.uniformMatrix3fv(h.normalMatrix,!1,e._normalMatrix.elements);null!==h.modelMatrix&&m.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function P(){var a=xa;a>=Jb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+
|
|
|
-Jb);xa+=1;return a}function I(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function C(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function B(a){a!==Ea&&(m.lineWidth(a),Ea=a)}function L(a,b,c){ya!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ya=a);!a||za===b&&ja===c||(m.polygonOffset(b,c),za=b,ja=c)}function H(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function J(a,b){var c;"fragment"===a?c=m.createShader(m.FRAGMENT_SHADER):
|
|
|
|
|
-"vertex"===a&&(c=m.createShader(m.VERTEX_SHADER));m.shaderSource(c,b);m.compileShader(c);return m.getShaderParameter(c,m.COMPILE_STATUS)?c:(console.error(m.getShaderInfoLog(c)),console.error(H(b)),null)}function y(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,D(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,D(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,D(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,D(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,
|
|
|
|
|
-m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,z(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,z(b.minFilter)));Oa&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,Oa.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Cb)),b.__oldAnisotropy=b.anisotropy)}function N(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,
|
|
|
|
|
-m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function z(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function D(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;
|
|
|
|
|
|
|
+Jb);xa+=1;return a}function I(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function z(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function B(a){a!==Ea&&(m.lineWidth(a),Ea=a)}function L(a,b,c){ya!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ya=a);!a||za===b&&ja===c||(m.polygonOffset(b,c),za=b,ja=c)}function H(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function J(a,b){var c;"fragment"===a?c=m.createShader(m.FRAGMENT_SHADER):
|
|
|
|
|
+"vertex"===a&&(c=m.createShader(m.VERTEX_SHADER));m.shaderSource(c,b);m.compileShader(c);return m.getShaderParameter(c,m.COMPILE_STATUS)?c:(console.error(m.getShaderInfoLog(c)),console.error(H(b)),null)}function y(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,C(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,C(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,C(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,C(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,
|
|
|
|
|
+m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,E(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,E(b.minFilter)));Oa&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,Oa.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Cb)),b.__oldAnisotropy=b.anisotropy)}function N(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,
|
|
|
|
|
+m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function E(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function C(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;
|
|
|
if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;
|
|
if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;
|
|
|
if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===
|
|
if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===
|
|
|
THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===
|
|
THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===
|
|
|
THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Ja){if(a===THREE.RGB_S3TC_DXT1_Format)return Ja.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ja.COMPRESSED_RGBA_S3TC_DXT1_EXT;
|
|
THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Ja){if(a===THREE.RGB_S3TC_DXT1_Format)return Ja.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ja.COMPRESSED_RGBA_S3TC_DXT1_EXT;
|
|
|
-if(a===THREE.RGBA_S3TC_DXT3_Format)return Ja.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ja.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var E=void 0!==a.canvas?a.canvas:document.createElement("canvas"),F=void 0!==a.context?a.context:null,X=void 0!==a.precision?a.precision:"highp",T=void 0!==a.alpha?a.alpha:!1,ea=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Y=void 0!==a.antialias?a.antialias:!1,la=void 0!==a.stencil?
|
|
|
|
|
-a.stencil:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ha=new THREE.Color(0),S=0;this.domElement=E;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;
|
|
|
|
|
-this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,R=[],ma=0,fa=null,Ka=null,U=-1,aa=null,Ca=null,oa=0,xa=0,va=-1,wa=-1,Qa=-1,Da=-1,Xa=-1,Za=-1,Ma=-1,Ra=-1,ya=null,za=null,ja=null,Ea=null,Fa=0,pa=0,Aa=E.width,Ba=E.height,$a=0,Na=
|
|
|
|
|
|
|
+if(a===THREE.RGBA_S3TC_DXT3_Format)return Ja.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ja.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=void 0!==a.context?a.context:null,X=void 0!==a.precision?a.precision:"highp",T=void 0!==a.alpha?a.alpha:!1,ea=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Y=void 0!==a.antialias?a.antialias:!1,la=void 0!==a.stencil?
|
|
|
|
|
+a.stencil:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ha=new THREE.Color(0),S=0;this.domElement=D;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;
|
|
|
|
|
+this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,R=[],ma=0,fa=null,Ka=null,U=-1,aa=null,Ca=null,oa=0,xa=0,va=-1,wa=-1,Qa=-1,Da=-1,Xa=-1,Za=-1,Ma=-1,Ra=-1,ya=null,za=null,ja=null,Ea=null,Fa=0,pa=0,Aa=D.width,Ba=D.height,$a=0,Na=
|
|
|
0,ga={},ia=new THREE.Frustum,Ga=new THREE.Matrix4,zb=new THREE.Matrix4,ua=new THREE.Vector3,ba=new THREE.Vector3,Pa=!0,Sa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,ta,ab,Oa,Ja;(function(){try{var a={alpha:T,premultipliedAlpha:ea,antialias:Y,stencil:la,preserveDrawingBuffer:Q};
|
|
0,ga={},ia=new THREE.Frustum,Ga=new THREE.Matrix4,zb=new THREE.Matrix4,ua=new THREE.Vector3,ba=new THREE.Vector3,Pa=!0,Sa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,ta,ab,Oa,Ja;(function(){try{var a={alpha:T,premultipliedAlpha:ea,antialias:Y,stencil:la,preserveDrawingBuffer:Q};
|
|
|
-m=F||E.getContext("webgl",a)||E.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}ta=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");ab=m.getExtension("OES_standard_derivatives");Oa=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ja=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||
|
|
|
|
|
|
|
+m=G||D.getContext("webgl",a)||D.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}ta=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");ab=m.getExtension("OES_standard_derivatives");Oa=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ja=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||
|
|
|
m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");ta||console.log("THREE.WebGLRenderer: Float textures not supported.");ab||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");Oa||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");Ja||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})})();m.clearColor(0,
|
|
m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");ta||console.log("THREE.WebGLRenderer: Float textures not supported.");ab||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");Oa||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");Ja||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})})();m.clearColor(0,
|
|
|
0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(Fa,pa,Aa,Ba);m.clearColor(ha.r,ha.g,ha.b,S);this.context=m;var Jb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),Yb=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);var Zb=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Cb=Oa?
|
|
0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(Fa,pa,Aa,Ba);m.clearColor(ha.r,ha.g,ha.b,S);this.context=m;var Jb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),Yb=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);var Zb=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Cb=Oa?
|
|
|
m.getParameter(Oa.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,xb=0<Yb,yb=xb&&ta;Ja&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var $b=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),ac=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var bc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),sc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,
|
|
m.getParameter(Oa.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,xb=0<Yb,yb=xb&&ta;Ja&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var $b=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),ac=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var bc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),sc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,
|
|
|
m.HIGH_INT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_INT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_INT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_INT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_INT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_INT);var tc=0<$b.precision&&0<bc.precision,Kb=0<ac.precision&&0<sc.precision;"highp"!==X||tc||(Kb?(X="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(X="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));
|
|
m.HIGH_INT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_INT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_INT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_INT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_INT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_INT);var tc=0<$b.precision&&0<bc.precision,Kb=0<ac.precision&&0<sc.precision;"highp"!==X||tc||(Kb?(X="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(X="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));
|
|
|
-"mediump"!==X||Kb||(X="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return m};this.supportsVertexTextures=function(){return xb};this.supportsFloatTextures=function(){return ta};this.supportsStandardDerivatives=function(){return ab};this.supportsCompressedTextureS3TC=function(){return Ja};this.getMaxAnisotropy=function(){return Cb};this.getPrecision=function(){return X};this.setSize=function(a,b,c){E.width=a*this.devicePixelRatio;E.height=b*this.devicePixelRatio;
|
|
|
|
|
-1!==this.devicePixelRatio&&!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*this.devicePixelRatio;pa=b*this.devicePixelRatio;Aa=c*this.devicePixelRatio;Ba=d*this.devicePixelRatio;m.viewport(Fa,pa,Aa,Ba)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};
|
|
|
|
|
|
|
+"mediump"!==X||Kb||(X="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return m};this.supportsVertexTextures=function(){return xb};this.supportsFloatTextures=function(){return ta};this.supportsStandardDerivatives=function(){return ab};this.supportsCompressedTextureS3TC=function(){return Ja};this.getMaxAnisotropy=function(){return Cb};this.getPrecision=function(){return X};this.setSize=function(a,b,c){D.width=a*this.devicePixelRatio;D.height=b*this.devicePixelRatio;
|
|
|
|
|
+1!==this.devicePixelRatio&&!1!==c&&(D.style.width=a+"px",D.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Fa=a*this.devicePixelRatio;pa=b*this.devicePixelRatio;Aa=c*this.devicePixelRatio;Ba=d*this.devicePixelRatio;m.viewport(Fa,pa,Aa,Ba)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};
|
|
|
this.setClearColor=function(a,b){ha.set(a);S=void 0!==b?b:1;m.clearColor(ha.r,ha.g,ha.b,S)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return ha};this.getClearAlpha=function(){return S};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=
|
|
this.setClearColor=function(a,b){ha.set(a);S=void 0!==b?b:1;m.clearColor(ha.r,ha.g,ha.b,S)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return ha};this.getClearAlpha=function(){return S};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=
|
|
|
function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){fa=null;U=aa=Ra=Ma=Qa=-1;Pa=!0;wa=va=-1;this.shadowMapPlugin.update(a,b)};var Lb=function(a){a=
|
|
function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){fa=null;U=aa=Ra=Ma=Qa=-1;Pa=!0;wa=va=-1;this.shadowMapPlugin.update(a,b)};var Lb=function(a){a=
|
|
|
a.target;a.removeEventListener("dispose",Lb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);M.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)m.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals)for(d=0,e=c.numMorphNormals;d<e;d++)m.deleteBuffer(c.__webglMorphNormalsBuffers[d]);
|
|
a.target;a.removeEventListener("dispose",Lb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);M.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)m.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals)for(d=0,e=c.numMorphNormals;d<e;d++)m.deleteBuffer(c.__webglMorphNormalsBuffers[d]);
|
|
@@ -437,11 +437,11 @@ M.info.memory.geometries--},Eb=function(a){var b=a.program;if(void 0!==b){a.prog
|
|
|
m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
|
|
m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
|
|
|
e,f,g,h,k,l,n,p,r,q,s=3*a.count;for(q=0;q<s;q+=9)r=a.normalArray,d=r[q],e=r[q+1],f=r[q+2],g=r[q+3],k=r[q+4],n=r[q+5],h=r[q+6],l=r[q+7],p=r[q+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+p)/3,r[q]=d,r[q+1]=e,r[q+2]=f,r[q+3]=d,r[q+4]=e,r[q+5]=f,r[q+6]=d,r[q+7]=e,r[q+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);m.enableVertexAttribArray(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,
|
|
e,f,g,h,k,l,n,p,r,q,s=3*a.count;for(q=0;q<s;q+=9)r=a.normalArray,d=r[q],e=r[q+1],f=r[q+2],g=r[q+3],k=r[q+4],n=r[q+5],h=r[q+6],l=r[q+7],p=r[q+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+p)/3,r[q]=d,r[q+1]=e,r[q+2]=f,r[q+3]=d,r[q+4]=e,r[q+5]=f,r[q+6]=d,r[q+7]=e,r[q+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);m.enableVertexAttribArray(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,
|
|
|
a.uvArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var l,
|
|
a.uvArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var l,
|
|
|
-n,p,r;l=G(a,b,c,d,f);a=l.attributes;b=e.attributes;c=!1;l=16777215*e.id+2*l.id+(d.wireframe?1:0);l!==aa&&(aa=l,c=!0);c&&k();if(f instanceof THREE.Mesh)if(f=b.index){e=e.offsets;1<e.length&&(c=!0);for(var q=0,s=e.length;q<s;q++){var t=e[q].index;if(c){for(n in a)p=a[n],l=b[n],0<=p&&(l?(r=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,r,m.FLOAT,!1,0,t*r*4)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):
|
|
|
|
|
|
|
+n,p,r;l=F(a,b,c,d,f);a=l.attributes;b=e.attributes;c=!1;l=16777215*e.id+2*l.id+(d.wireframe?1:0);l!==aa&&(aa=l,c=!0);c&&k();if(f instanceof THREE.Mesh)if(f=b.index){e=e.offsets;1<e.length&&(c=!0);for(var q=0,s=e.length;q<s;q++){var t=e[q].index;if(c){for(n in a)p=a[n],l=b[n],0<=p&&(l?(r=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,r,m.FLOAT,!1,0,t*r*4)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):
|
|
|
3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)}m.drawElements(m.TRIANGLES,e[q].count,m.UNSIGNED_SHORT,2*e[q].start);M.info.render.calls++;M.info.render.vertices+=e[q].count;M.info.render.faces+=e[q].count/3}}else{if(c)for(n in a)"index"!==n&&(p=a[n],l=b[n],0<=p&&(l?(r=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,r,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&
|
|
3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)}m.drawElements(m.TRIANGLES,e[q].count,m.UNSIGNED_SHORT,2*e[q].start);M.info.render.calls++;M.info.render.vertices+=e[q].count;M.info.render.faces+=e[q].count/3}}else{if(c)for(n in a)"index"!==n&&(p=a[n],l=b[n],0<=p&&(l?(r=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,r,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&
|
|
|
(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n]))));d=e.attributes.position;m.drawArrays(m.TRIANGLES,0,d.array.length/3);M.info.render.calls++;M.info.render.vertices+=d.array.length/3;M.info.render.faces+=d.array.length/3/3}else if(f instanceof THREE.ParticleSystem){if(c)for(n in a)p=a[n],l=b[n],0<=p&&(l?(r=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,
|
|
(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n]))));d=e.attributes.position;m.drawArrays(m.TRIANGLES,0,d.array.length/3);M.info.render.calls++;M.info.render.vertices+=d.array.length/3;M.info.render.faces+=d.array.length/3/3}else if(f instanceof THREE.ParticleSystem){if(c)for(n in a)p=a[n],l=b[n],0<=p&&(l?(r=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,
|
|
|
r,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));d=b.position;m.drawArrays(m.POINTS,0,d.array.length/3);M.info.render.calls++;M.info.render.points+=d.array.length/3}else if(f instanceof THREE.Line)if(n=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,B(d.linewidth),f=b.index)for(e=e.offsets,1<e.length&&
|
|
r,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));d=b.position;m.drawArrays(m.POINTS,0,d.array.length/3);M.info.render.calls++;M.info.render.points+=d.array.length/3}else if(f instanceof THREE.Line)if(n=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,B(d.linewidth),f=b.index)for(e=e.offsets,1<e.length&&
|
|
|
-(c=!0),q=0,s=e.length;q<s;q++)t=e[q].index,c&&(g(d,a,b,t),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[q].count,m.UNSIGNED_SHORT,2*e[q].start),M.info.render.calls++,M.info.render.vertices+=e[q].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(n,0,d.array.length/3),M.info.render.calls++,M.info.render.points+=d.array.length}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,l;c=G(a,b,c,d,f);a=c.attributes;b=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==
|
|
|
|
|
|
|
+(c=!0),q=0,s=e.length;q<s;q++)t=e[q].index,c&&(g(d,a,b,t),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[q].count,m.UNSIGNED_SHORT,2*e[q].start),M.info.render.calls++,M.info.render.vertices+=e[q].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(n,0,d.array.length/3),M.info.render.calls++,M.info.render.points+=d.array.length}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,l;c=F(a,b,c,d,f);a=c.attributes;b=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==
|
|
|
aa&&(aa=c,b=!0);b&&k();if(!d.morphTargets&&0<=a.position)b&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),m.vertexAttribPointer(c.position,
|
|
aa&&(aa=c,b=!0);b&&k();if(!d.morphTargets&&0<=a.position)b&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),m.vertexAttribPointer(c.position,
|
|
|
3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;l=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<l.length;)0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[p]]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[p]]),h(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,
|
|
3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;l=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<l.length;)0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[p]]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[p]]),h(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,
|
|
|
m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[l[p]],p++}else{l=[];g=f.morphTargetInfluences;var r,q=g.length;for(r=0;r<q;r++)p=g[r],0<p&&l.push([p,r]);l.length>d.numSupportedMorphTargets?(l.sort(n),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(n):0===l.length&&l.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)l[p]?(r=l[p][1],0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+
|
|
m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[l[p]],p++}else{l=[];g=f.morphTargetInfluences;var r,q=g.length;for(r=0;r<q;r++)p=g[r],0<p&&l.push([p,r]);l.length>d.numSupportedMorphTargets?(l.sort(n),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(n):0===l.length&&l.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)l[p]?(r=l[p][1],0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+
|
|
@@ -456,24 +456,24 @@ h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.rend
|
|
|
null):(p.opaque=t,p.transparent=null);else if(t=v)t.transparent?(p.transparent=t,p.opaque=null):(p.opaque=t,p.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ua.setFromMatrixPosition(g.matrixWorld),ua.applyProjection(Ga),f.z=ua.z))}this.sortObjects&&h.sort(l);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),
|
|
null):(p.opaque=t,p.transparent=null);else if(t=v)t.transparent?(p.transparent=t,p.opaque=null):(p.opaque=t,p.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ua.setFromMatrixPosition(g.matrixWorld),ua.applyProjection(Ga),f.z=ua.z))}this.sortObjects&&h.sort(l);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),
|
|
|
g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),L(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),s(a.__webglObjects,!1,"",b,k,n,!0,d),u(a.__webglObjectsImmediate,"",b,k,n,!1,d)):(d=null,this.setBlending(THREE.NoBlending),s(a.__webglObjects,!0,"opaque",b,k,n,!1,d),u(a.__webglObjectsImmediate,
|
|
g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),L(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),s(a.__webglObjects,!1,"",b,k,n,!0,d),u(a.__webglObjectsImmediate,"",b,k,n,!1,d)):(d=null,this.setBlending(THREE.NoBlending),s(a.__webglObjects,!0,"opaque",b,k,n,!1,d),u(a.__webglObjectsImmediate,
|
|
|
"opaque",b,k,n,!1,d),s(a.__webglObjects,!1,"transparent",b,k,n,!0,d),u(a.__webglObjectsImmediate,"transparent",b,k,n,!0,d));q(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,
|
|
"opaque",b,k,n,!1,d),s(a.__webglObjects,!1,"transparent",b,k,n,!0,d),u(a.__webglObjectsImmediate,"transparent",b,k,n,!0,d));q(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,
|
|
|
-null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=G(a,b,c,d,e);aa=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,ia):e.render(function(a){M.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)t(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)r(a.__objectsRemoved[0],
|
|
|
|
|
|
|
+null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=F(a,b,c,d,e);aa=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,ia):e.render(function(a){M.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)t(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)r(a.__objectsRemoved[0],
|
|
|
a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&r(h,a),t(h,a));var k=h,l=k.geometry,p=void 0,q=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var u=m.DYNAMIC_DRAW,x=!l.dynamic,A=l.attributes,y=void 0,B=void 0;for(y in A)B=A[y],B.needsUpdate&&("index"===y?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,B.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,B.array,u)):(m.bindBuffer(m.ARRAY_BUFFER,
|
|
a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&r(h,a),t(h,a));var k=h,l=k.geometry,p=void 0,q=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var u=m.DYNAMIC_DRAW,x=!l.dynamic,A=l.attributes,y=void 0,B=void 0;for(y in A)B=A[y],B.needsUpdate&&("index"===y?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,B.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,B.array,u)):(m.bindBuffer(m.ARRAY_BUFFER,
|
|
|
-B.buffer),m.bufferData(m.ARRAY_BUFFER,B.array,u)),B.needsUpdate=!1),x&&!B.dynamic&&(B.array=null)}else if(k instanceof THREE.Mesh){for(var E=0,C=l.geometryGroupsList.length;E<C;E++)if(p=l.geometryGroupsList[E],s=d(k,p),l.buffersNeedUpdate&&c(p,k),q=s.attributes&&v(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||q){var z=p,G=k,D=m.DYNAMIC_DRAW,L=!l.dynamic,H=s;if(z.__inittedArrays){var I=e(H),P=
|
|
|
|
|
-H.vertexColors?H.vertexColors:!1,M=f(H),N=I===THREE.SmoothShading,F=void 0,R=void 0,Q=void 0,J=void 0,X=void 0,T=void 0,S=void 0,fa=void 0,aa=void 0,Y=void 0,ma=void 0,U=void 0,$=void 0,Z=void 0,oa=void 0,xa=void 0,Ca=void 0,ba=void 0,Ka=void 0,ea=void 0,ga=void 0,ha=void 0,ia=void 0,va=void 0,ja=void 0,la=void 0,wa=void 0,ta=void 0,za=void 0,La=void 0,Ea=void 0,Fa=void 0,Ja=void 0,Qa=void 0,pa=void 0,Na=void 0,ya=void 0,Da=void 0,Pa=void 0,Xa=void 0,Aa=0,Ba=0,Oa=0,Ra=0,Za=0,ib=0,Ya=0,Ma=0,fb=0,sa=
|
|
|
|
|
-0,Ha=0,O=0,Wa=void 0,jb=z.__vertexArray,$a=z.__uvArray,ab=z.__uv2Array,Sa=z.__normalArray,bb=z.__tangentArray,kb=z.__colorArray,cb=z.__skinIndexArray,db=z.__skinWeightArray,xb=z.__morphTargetsArrays,yb=z.__morphNormalsArrays,tb=z.__webglCustomAttributesList,K=void 0,Ob=z.__faceArray,ub=z.__lineArray,Ta=G.geometry,Jb=Ta.elementsNeedUpdate,Cb=Ta.uvsNeedUpdate,Kb=Ta.normalsNeedUpdate,Lb=Ta.tangentsNeedUpdate,Mb=Ta.colorsNeedUpdate,Nb=Ta.morphTargetsNeedUpdate,dc=Ta.vertices,da=z.faces3,lb=Ta.faces,Db=
|
|
|
|
|
-Ta.faceVertexUvs[0],Eb=Ta.faceVertexUvs[1],ec=Ta.skinIndices,Pb=Ta.skinWeights,Qb=Ta.morphTargets,jc=Ta.morphNormals;if(Ta.verticesNeedUpdate){F=0;for(R=da.length;F<R;F++)J=lb[da[F]],U=dc[J.a],$=dc[J.b],Z=dc[J.c],jb[Ba]=U.x,jb[Ba+1]=U.y,jb[Ba+2]=U.z,jb[Ba+3]=$.x,jb[Ba+4]=$.y,jb[Ba+5]=$.z,jb[Ba+6]=Z.x,jb[Ba+7]=Z.y,jb[Ba+8]=Z.z,Ba+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,jb,D)}if(Nb)for(pa=0,Na=Qb.length;pa<Na;pa++){F=Ha=0;for(R=da.length;F<R;F++)Pa=da[F],J=
|
|
|
|
|
-lb[Pa],U=Qb[pa].vertices[J.a],$=Qb[pa].vertices[J.b],Z=Qb[pa].vertices[J.c],ya=xb[pa],ya[Ha]=U.x,ya[Ha+1]=U.y,ya[Ha+2]=U.z,ya[Ha+3]=$.x,ya[Ha+4]=$.y,ya[Ha+5]=$.z,ya[Ha+6]=Z.x,ya[Ha+7]=Z.y,ya[Ha+8]=Z.z,H.morphNormals&&(N?(Xa=jc[pa].vertexNormals[Pa],ba=Xa.a,Ka=Xa.b,ea=Xa.c):ea=Ka=ba=jc[pa].faceNormals[Pa],Da=yb[pa],Da[Ha]=ba.x,Da[Ha+1]=ba.y,Da[Ha+2]=ba.z,Da[Ha+3]=Ka.x,Da[Ha+4]=Ka.y,Da[Ha+5]=Ka.z,Da[Ha+6]=ea.x,Da[Ha+7]=ea.y,Da[Ha+8]=ea.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphTargetsBuffers[pa]);
|
|
|
|
|
-m.bufferData(m.ARRAY_BUFFER,xb[pa],D);H.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphNormalsBuffers[pa]),m.bufferData(m.ARRAY_BUFFER,yb[pa],D))}if(Pb.length){F=0;for(R=da.length;F<R;F++)J=lb[da[F]],va=Pb[J.a],ja=Pb[J.b],la=Pb[J.c],db[sa]=va.x,db[sa+1]=va.y,db[sa+2]=va.z,db[sa+3]=va.w,db[sa+4]=ja.x,db[sa+5]=ja.y,db[sa+6]=ja.z,db[sa+7]=ja.w,db[sa+8]=la.x,db[sa+9]=la.y,db[sa+10]=la.z,db[sa+11]=la.w,wa=ec[J.a],ta=ec[J.b],za=ec[J.c],cb[sa]=wa.x,cb[sa+1]=wa.y,cb[sa+2]=wa.z,cb[sa+3]=wa.w,cb[sa+
|
|
|
|
|
-4]=ta.x,cb[sa+5]=ta.y,cb[sa+6]=ta.z,cb[sa+7]=ta.w,cb[sa+8]=za.x,cb[sa+9]=za.y,cb[sa+10]=za.z,cb[sa+11]=za.w,sa+=12;0<sa&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,cb,D),m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,db,D))}if(Mb&&P){F=0;for(R=da.length;F<R;F++)J=lb[da[F]],S=J.vertexColors,fa=J.color,3===S.length&&P===THREE.VertexColors?(ga=S[0],ha=S[1],ia=S[2]):ia=ha=ga=fa,kb[fb]=ga.r,kb[fb+1]=ga.g,kb[fb+2]=ga.b,kb[fb+
|
|
|
|
|
-3]=ha.r,kb[fb+4]=ha.g,kb[fb+5]=ha.b,kb[fb+6]=ia.r,kb[fb+7]=ia.g,kb[fb+8]=ia.b,fb+=9;0<fb&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,kb,D))}if(Lb&&Ta.hasTangents){F=0;for(R=da.length;F<R;F++)J=lb[da[F]],aa=J.vertexTangents,oa=aa[0],xa=aa[1],Ca=aa[2],bb[Ya]=oa.x,bb[Ya+1]=oa.y,bb[Ya+2]=oa.z,bb[Ya+3]=oa.w,bb[Ya+4]=xa.x,bb[Ya+5]=xa.y,bb[Ya+6]=xa.z,bb[Ya+7]=xa.w,bb[Ya+8]=Ca.x,bb[Ya+9]=Ca.y,bb[Ya+10]=Ca.z,bb[Ya+11]=Ca.w,Ya+=12;m.bindBuffer(m.ARRAY_BUFFER,z.__webglTangentBuffer);
|
|
|
|
|
-m.bufferData(m.ARRAY_BUFFER,bb,D)}if(Kb&&I){F=0;for(R=da.length;F<R;F++)if(J=lb[da[F]],X=J.vertexNormals,T=J.normal,3===X.length&&N)for(La=0;3>La;La++)Fa=X[La],Sa[ib]=Fa.x,Sa[ib+1]=Fa.y,Sa[ib+2]=Fa.z,ib+=3;else for(La=0;3>La;La++)Sa[ib]=T.x,Sa[ib+1]=T.y,Sa[ib+2]=T.z,ib+=3;m.bindBuffer(m.ARRAY_BUFFER,z.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,Sa,D)}if(Cb&&Db&&M){F=0;for(R=da.length;F<R;F++)if(Q=da[F],Y=Db[Q],void 0!==Y)for(La=0;3>La;La++)Ja=Y[La],$a[Oa]=Ja.x,$a[Oa+1]=Ja.y,Oa+=2;0<Oa&&(m.bindBuffer(m.ARRAY_BUFFER,
|
|
|
|
|
-z.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,$a,D))}if(Cb&&Eb&&M){F=0;for(R=da.length;F<R;F++)if(Q=da[F],ma=Eb[Q],void 0!==ma)for(La=0;3>La;La++)Qa=ma[La],ab[Ra]=Qa.x,ab[Ra+1]=Qa.y,Ra+=2;0<Ra&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ab,D))}if(Jb){F=0;for(R=da.length;F<R;F++)Ob[Za]=Aa,Ob[Za+1]=Aa+1,Ob[Za+2]=Aa+2,Za+=3,ub[Ma]=Aa,ub[Ma+1]=Aa+1,ub[Ma+2]=Aa,ub[Ma+3]=Aa+2,ub[Ma+4]=Aa+1,ub[Ma+5]=Aa+2,Ma+=6,Aa+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglFaceBuffer);
|
|
|
|
|
-m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ob,D);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,D)}if(tb)for(La=0,Ea=tb.length;La<Ea;La++)if(K=tb[La],K.__original.needsUpdate){O=0;if(1===K.size)if(void 0===K.boundTo||"vertices"===K.boundTo)for(F=0,R=da.length;F<R;F++)J=lb[da[F]],K.array[O]=K.value[J.a],K.array[O+1]=K.value[J.b],K.array[O+2]=K.value[J.c],O+=3;else{if("faces"===K.boundTo)for(F=0,R=da.length;F<R;F++)Wa=K.value[da[F]],K.array[O]=Wa,K.array[O+
|
|
|
|
|
-1]=Wa,K.array[O+2]=Wa,O+=3}else if(2===K.size)if(void 0===K.boundTo||"vertices"===K.boundTo)for(F=0,R=da.length;F<R;F++)J=lb[da[F]],U=K.value[J.a],$=K.value[J.b],Z=K.value[J.c],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=$.x,K.array[O+3]=$.y,K.array[O+4]=Z.x,K.array[O+5]=Z.y,O+=6;else{if("faces"===K.boundTo)for(F=0,R=da.length;F<R;F++)Z=$=U=Wa=K.value[da[F]],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=$.x,K.array[O+3]=$.y,K.array[O+4]=Z.x,K.array[O+5]=Z.y,O+=6}else if(3===K.size){var ra;ra="c"===
|
|
|
|
|
-K.type?["r","g","b"]:["x","y","z"];if(void 0===K.boundTo||"vertices"===K.boundTo)for(F=0,R=da.length;F<R;F++)J=lb[da[F]],U=K.value[J.a],$=K.value[J.b],Z=K.value[J.c],K.array[O]=U[ra[0]],K.array[O+1]=U[ra[1]],K.array[O+2]=U[ra[2]],K.array[O+3]=$[ra[0]],K.array[O+4]=$[ra[1]],K.array[O+5]=$[ra[2]],K.array[O+6]=Z[ra[0]],K.array[O+7]=Z[ra[1]],K.array[O+8]=Z[ra[2]],O+=9;else if("faces"===K.boundTo)for(F=0,R=da.length;F<R;F++)Z=$=U=Wa=K.value[da[F]],K.array[O]=U[ra[0]],K.array[O+1]=U[ra[1]],K.array[O+2]=
|
|
|
|
|
-U[ra[2]],K.array[O+3]=$[ra[0]],K.array[O+4]=$[ra[1]],K.array[O+5]=$[ra[2]],K.array[O+6]=Z[ra[0]],K.array[O+7]=Z[ra[1]],K.array[O+8]=Z[ra[2]],O+=9;else if("faceVertices"===K.boundTo)for(F=0,R=da.length;F<R;F++)Wa=K.value[da[F]],U=Wa[0],$=Wa[1],Z=Wa[2],K.array[O]=U[ra[0]],K.array[O+1]=U[ra[1]],K.array[O+2]=U[ra[2]],K.array[O+3]=$[ra[0]],K.array[O+4]=$[ra[1]],K.array[O+5]=$[ra[2]],K.array[O+6]=Z[ra[0]],K.array[O+7]=Z[ra[1]],K.array[O+8]=Z[ra[2]],O+=9}else if(4===K.size)if(void 0===K.boundTo||"vertices"===
|
|
|
|
|
-K.boundTo)for(F=0,R=da.length;F<R;F++)J=lb[da[F]],U=K.value[J.a],$=K.value[J.b],Z=K.value[J.c],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=U.z,K.array[O+3]=U.w,K.array[O+4]=$.x,K.array[O+5]=$.y,K.array[O+6]=$.z,K.array[O+7]=$.w,K.array[O+8]=Z.x,K.array[O+9]=Z.y,K.array[O+10]=Z.z,K.array[O+11]=Z.w,O+=12;else if("faces"===K.boundTo)for(F=0,R=da.length;F<R;F++)Z=$=U=Wa=K.value[da[F]],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=U.z,K.array[O+3]=U.w,K.array[O+4]=$.x,K.array[O+5]=$.y,K.array[O+6]=$.z,
|
|
|
|
|
-K.array[O+7]=$.w,K.array[O+8]=Z.x,K.array[O+9]=Z.y,K.array[O+10]=Z.z,K.array[O+11]=Z.w,O+=12;else if("faceVertices"===K.boundTo)for(F=0,R=da.length;F<R;F++)Wa=K.value[da[F]],U=Wa[0],$=Wa[1],Z=Wa[2],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=U.z,K.array[O+3]=U.w,K.array[O+4]=$.x,K.array[O+5]=$.y,K.array[O+6]=$.z,K.array[O+7]=$.w,K.array[O+8]=Z.x,K.array[O+9]=Z.y,K.array[O+10]=Z.z,K.array[O+11]=Z.w,O+=12;m.bindBuffer(m.ARRAY_BUFFER,K.buffer);m.bufferData(m.ARRAY_BUFFER,K.array,D)}L&&(delete z.__inittedArrays,
|
|
|
|
|
|
|
+B.buffer),m.bufferData(m.ARRAY_BUFFER,B.array,u)),B.needsUpdate=!1),x&&!B.dynamic&&(B.array=null)}else if(k instanceof THREE.Mesh){for(var D=0,C=l.geometryGroupsList.length;D<C;D++)if(p=l.geometryGroupsList[D],s=d(k,p),l.buffersNeedUpdate&&c(p,k),q=s.attributes&&v(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||q){var z=p,E=k,F=m.DYNAMIC_DRAW,L=!l.dynamic,H=s;if(z.__inittedArrays){var I=e(H),P=
|
|
|
|
|
+H.vertexColors?H.vertexColors:!1,M=f(H),N=I===THREE.SmoothShading,G=void 0,R=void 0,Q=void 0,J=void 0,X=void 0,T=void 0,S=void 0,fa=void 0,aa=void 0,Y=void 0,ma=void 0,U=void 0,$=void 0,Z=void 0,oa=void 0,Ca=void 0,xa=void 0,ba=void 0,ea=void 0,ga=void 0,Ka=void 0,ha=void 0,ia=void 0,va=void 0,ja=void 0,la=void 0,wa=void 0,ta=void 0,za=void 0,La=void 0,Ea=void 0,Fa=void 0,Ja=void 0,Qa=void 0,pa=void 0,Na=void 0,ya=void 0,Da=void 0,Pa=void 0,Xa=void 0,Aa=0,Ba=0,Oa=0,Ra=0,Za=0,ib=0,Ya=0,Ma=0,fb=0,sa=
|
|
|
|
|
+0,Ha=0,O=0,Wa=void 0,jb=z.__vertexArray,$a=z.__uvArray,ab=z.__uv2Array,Sa=z.__normalArray,bb=z.__tangentArray,kb=z.__colorArray,cb=z.__skinIndexArray,db=z.__skinWeightArray,xb=z.__morphTargetsArrays,yb=z.__morphNormalsArrays,tb=z.__webglCustomAttributesList,K=void 0,Ob=z.__faceArray,ub=z.__lineArray,Ta=E.geometry,Jb=Ta.elementsNeedUpdate,Cb=Ta.uvsNeedUpdate,Kb=Ta.normalsNeedUpdate,Lb=Ta.tangentsNeedUpdate,Mb=Ta.colorsNeedUpdate,Nb=Ta.morphTargetsNeedUpdate,dc=Ta.vertices,da=z.faces3,lb=Ta.faces,Db=
|
|
|
|
|
+Ta.faceVertexUvs[0],Eb=Ta.faceVertexUvs[1],ec=Ta.skinIndices,Pb=Ta.skinWeights,Qb=Ta.morphTargets,jc=Ta.morphNormals;if(Ta.verticesNeedUpdate){G=0;for(R=da.length;G<R;G++)J=lb[da[G]],U=dc[J.a],$=dc[J.b],Z=dc[J.c],jb[Ba]=U.x,jb[Ba+1]=U.y,jb[Ba+2]=U.z,jb[Ba+3]=$.x,jb[Ba+4]=$.y,jb[Ba+5]=$.z,jb[Ba+6]=Z.x,jb[Ba+7]=Z.y,jb[Ba+8]=Z.z,Ba+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,jb,F)}if(Nb)for(pa=0,Na=Qb.length;pa<Na;pa++){G=Ha=0;for(R=da.length;G<R;G++)Pa=da[G],J=
|
|
|
|
|
+lb[Pa],U=Qb[pa].vertices[J.a],$=Qb[pa].vertices[J.b],Z=Qb[pa].vertices[J.c],ya=xb[pa],ya[Ha]=U.x,ya[Ha+1]=U.y,ya[Ha+2]=U.z,ya[Ha+3]=$.x,ya[Ha+4]=$.y,ya[Ha+5]=$.z,ya[Ha+6]=Z.x,ya[Ha+7]=Z.y,ya[Ha+8]=Z.z,H.morphNormals&&(N?(Xa=jc[pa].vertexNormals[Pa],ba=Xa.a,ea=Xa.b,ga=Xa.c):ga=ea=ba=jc[pa].faceNormals[Pa],Da=yb[pa],Da[Ha]=ba.x,Da[Ha+1]=ba.y,Da[Ha+2]=ba.z,Da[Ha+3]=ea.x,Da[Ha+4]=ea.y,Da[Ha+5]=ea.z,Da[Ha+6]=ga.x,Da[Ha+7]=ga.y,Da[Ha+8]=ga.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphTargetsBuffers[pa]);
|
|
|
|
|
+m.bufferData(m.ARRAY_BUFFER,xb[pa],F);H.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphNormalsBuffers[pa]),m.bufferData(m.ARRAY_BUFFER,yb[pa],F))}if(Pb.length){G=0;for(R=da.length;G<R;G++)J=lb[da[G]],va=Pb[J.a],ja=Pb[J.b],la=Pb[J.c],db[sa]=va.x,db[sa+1]=va.y,db[sa+2]=va.z,db[sa+3]=va.w,db[sa+4]=ja.x,db[sa+5]=ja.y,db[sa+6]=ja.z,db[sa+7]=ja.w,db[sa+8]=la.x,db[sa+9]=la.y,db[sa+10]=la.z,db[sa+11]=la.w,wa=ec[J.a],ta=ec[J.b],za=ec[J.c],cb[sa]=wa.x,cb[sa+1]=wa.y,cb[sa+2]=wa.z,cb[sa+3]=wa.w,cb[sa+
|
|
|
|
|
+4]=ta.x,cb[sa+5]=ta.y,cb[sa+6]=ta.z,cb[sa+7]=ta.w,cb[sa+8]=za.x,cb[sa+9]=za.y,cb[sa+10]=za.z,cb[sa+11]=za.w,sa+=12;0<sa&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,cb,F),m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,db,F))}if(Mb&&P){G=0;for(R=da.length;G<R;G++)J=lb[da[G]],S=J.vertexColors,fa=J.color,3===S.length&&P===THREE.VertexColors?(Ka=S[0],ha=S[1],ia=S[2]):ia=ha=Ka=fa,kb[fb]=Ka.r,kb[fb+1]=Ka.g,kb[fb+2]=Ka.b,kb[fb+
|
|
|
|
|
+3]=ha.r,kb[fb+4]=ha.g,kb[fb+5]=ha.b,kb[fb+6]=ia.r,kb[fb+7]=ia.g,kb[fb+8]=ia.b,fb+=9;0<fb&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,kb,F))}if(Lb&&Ta.hasTangents){G=0;for(R=da.length;G<R;G++)J=lb[da[G]],aa=J.vertexTangents,oa=aa[0],Ca=aa[1],xa=aa[2],bb[Ya]=oa.x,bb[Ya+1]=oa.y,bb[Ya+2]=oa.z,bb[Ya+3]=oa.w,bb[Ya+4]=Ca.x,bb[Ya+5]=Ca.y,bb[Ya+6]=Ca.z,bb[Ya+7]=Ca.w,bb[Ya+8]=xa.x,bb[Ya+9]=xa.y,bb[Ya+10]=xa.z,bb[Ya+11]=xa.w,Ya+=12;m.bindBuffer(m.ARRAY_BUFFER,z.__webglTangentBuffer);
|
|
|
|
|
+m.bufferData(m.ARRAY_BUFFER,bb,F)}if(Kb&&I){G=0;for(R=da.length;G<R;G++)if(J=lb[da[G]],X=J.vertexNormals,T=J.normal,3===X.length&&N)for(La=0;3>La;La++)Fa=X[La],Sa[ib]=Fa.x,Sa[ib+1]=Fa.y,Sa[ib+2]=Fa.z,ib+=3;else for(La=0;3>La;La++)Sa[ib]=T.x,Sa[ib+1]=T.y,Sa[ib+2]=T.z,ib+=3;m.bindBuffer(m.ARRAY_BUFFER,z.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,Sa,F)}if(Cb&&Db&&M){G=0;for(R=da.length;G<R;G++)if(Q=da[G],Y=Db[Q],void 0!==Y)for(La=0;3>La;La++)Ja=Y[La],$a[Oa]=Ja.x,$a[Oa+1]=Ja.y,Oa+=2;0<Oa&&(m.bindBuffer(m.ARRAY_BUFFER,
|
|
|
|
|
+z.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,$a,F))}if(Cb&&Eb&&M){G=0;for(R=da.length;G<R;G++)if(Q=da[G],ma=Eb[Q],void 0!==ma)for(La=0;3>La;La++)Qa=ma[La],ab[Ra]=Qa.x,ab[Ra+1]=Qa.y,Ra+=2;0<Ra&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ab,F))}if(Jb){G=0;for(R=da.length;G<R;G++)Ob[Za]=Aa,Ob[Za+1]=Aa+1,Ob[Za+2]=Aa+2,Za+=3,ub[Ma]=Aa,ub[Ma+1]=Aa+1,ub[Ma+2]=Aa,ub[Ma+3]=Aa+2,ub[Ma+4]=Aa+1,ub[Ma+5]=Aa+2,Ma+=6,Aa+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglFaceBuffer);
|
|
|
|
|
+m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ob,F);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,F)}if(tb)for(La=0,Ea=tb.length;La<Ea;La++)if(K=tb[La],K.__original.needsUpdate){O=0;if(1===K.size)if(void 0===K.boundTo||"vertices"===K.boundTo)for(G=0,R=da.length;G<R;G++)J=lb[da[G]],K.array[O]=K.value[J.a],K.array[O+1]=K.value[J.b],K.array[O+2]=K.value[J.c],O+=3;else{if("faces"===K.boundTo)for(G=0,R=da.length;G<R;G++)Wa=K.value[da[G]],K.array[O]=Wa,K.array[O+
|
|
|
|
|
+1]=Wa,K.array[O+2]=Wa,O+=3}else if(2===K.size)if(void 0===K.boundTo||"vertices"===K.boundTo)for(G=0,R=da.length;G<R;G++)J=lb[da[G]],U=K.value[J.a],$=K.value[J.b],Z=K.value[J.c],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=$.x,K.array[O+3]=$.y,K.array[O+4]=Z.x,K.array[O+5]=Z.y,O+=6;else{if("faces"===K.boundTo)for(G=0,R=da.length;G<R;G++)Z=$=U=Wa=K.value[da[G]],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=$.x,K.array[O+3]=$.y,K.array[O+4]=Z.x,K.array[O+5]=Z.y,O+=6}else if(3===K.size){var ra;ra="c"===
|
|
|
|
|
+K.type?["r","g","b"]:["x","y","z"];if(void 0===K.boundTo||"vertices"===K.boundTo)for(G=0,R=da.length;G<R;G++)J=lb[da[G]],U=K.value[J.a],$=K.value[J.b],Z=K.value[J.c],K.array[O]=U[ra[0]],K.array[O+1]=U[ra[1]],K.array[O+2]=U[ra[2]],K.array[O+3]=$[ra[0]],K.array[O+4]=$[ra[1]],K.array[O+5]=$[ra[2]],K.array[O+6]=Z[ra[0]],K.array[O+7]=Z[ra[1]],K.array[O+8]=Z[ra[2]],O+=9;else if("faces"===K.boundTo)for(G=0,R=da.length;G<R;G++)Z=$=U=Wa=K.value[da[G]],K.array[O]=U[ra[0]],K.array[O+1]=U[ra[1]],K.array[O+2]=
|
|
|
|
|
+U[ra[2]],K.array[O+3]=$[ra[0]],K.array[O+4]=$[ra[1]],K.array[O+5]=$[ra[2]],K.array[O+6]=Z[ra[0]],K.array[O+7]=Z[ra[1]],K.array[O+8]=Z[ra[2]],O+=9;else if("faceVertices"===K.boundTo)for(G=0,R=da.length;G<R;G++)Wa=K.value[da[G]],U=Wa[0],$=Wa[1],Z=Wa[2],K.array[O]=U[ra[0]],K.array[O+1]=U[ra[1]],K.array[O+2]=U[ra[2]],K.array[O+3]=$[ra[0]],K.array[O+4]=$[ra[1]],K.array[O+5]=$[ra[2]],K.array[O+6]=Z[ra[0]],K.array[O+7]=Z[ra[1]],K.array[O+8]=Z[ra[2]],O+=9}else if(4===K.size)if(void 0===K.boundTo||"vertices"===
|
|
|
|
|
+K.boundTo)for(G=0,R=da.length;G<R;G++)J=lb[da[G]],U=K.value[J.a],$=K.value[J.b],Z=K.value[J.c],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=U.z,K.array[O+3]=U.w,K.array[O+4]=$.x,K.array[O+5]=$.y,K.array[O+6]=$.z,K.array[O+7]=$.w,K.array[O+8]=Z.x,K.array[O+9]=Z.y,K.array[O+10]=Z.z,K.array[O+11]=Z.w,O+=12;else if("faces"===K.boundTo)for(G=0,R=da.length;G<R;G++)Z=$=U=Wa=K.value[da[G]],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=U.z,K.array[O+3]=U.w,K.array[O+4]=$.x,K.array[O+5]=$.y,K.array[O+6]=$.z,
|
|
|
|
|
+K.array[O+7]=$.w,K.array[O+8]=Z.x,K.array[O+9]=Z.y,K.array[O+10]=Z.z,K.array[O+11]=Z.w,O+=12;else if("faceVertices"===K.boundTo)for(G=0,R=da.length;G<R;G++)Wa=K.value[da[G]],U=Wa[0],$=Wa[1],Z=Wa[2],K.array[O]=U.x,K.array[O+1]=U.y,K.array[O+2]=U.z,K.array[O+3]=U.w,K.array[O+4]=$.x,K.array[O+5]=$.y,K.array[O+6]=$.z,K.array[O+7]=$.w,K.array[O+8]=Z.x,K.array[O+9]=Z.y,K.array[O+10]=Z.z,K.array[O+11]=Z.w,O+=12;m.bindBuffer(m.ARRAY_BUFFER,K.buffer);m.bufferData(m.ARRAY_BUFFER,K.array,F)}L&&(delete z.__inittedArrays,
|
|
|
delete z.__colorArray,delete z.__normalArray,delete z.__tangentArray,delete z.__uvArray,delete z.__uv2Array,delete z.__faceArray,delete z.__vertexArray,delete z.__lineArray,delete z.__skinIndexArray,delete z.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&w(s)}else if(k instanceof THREE.Line){s=d(k,l);q=s.attributes&&v(s);if(l.verticesNeedUpdate||
|
|
delete z.__colorArray,delete z.__normalArray,delete z.__tangentArray,delete z.__uvArray,delete z.__uv2Array,delete z.__faceArray,delete z.__vertexArray,delete z.__lineArray,delete z.__skinIndexArray,delete z.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&w(s)}else if(k instanceof THREE.Line){s=d(k,l);q=s.attributes&&v(s);if(l.verticesNeedUpdate||
|
|
|
l.colorsNeedUpdate||l.lineDistancesNeedUpdate||q){var eb=l,Rb=m.DYNAMIC_DRAW,Fb=void 0,Gb=void 0,Hb=void 0,Sb=void 0,qa=void 0,Tb=void 0,kc=eb.vertices,lc=eb.colors,mc=eb.lineDistances,Yb=kc.length,Zb=lc.length,$b=mc.length,Ub=eb.__vertexArray,Vb=eb.__colorArray,nc=eb.__lineDistanceArray,ac=eb.colorsNeedUpdate,bc=eb.lineDistancesNeedUpdate,fc=eb.__webglCustomAttributesList,Wb=void 0,oc=void 0,Ia=void 0,Ab=void 0,Ua=void 0,na=void 0;if(eb.verticesNeedUpdate){for(Fb=0;Fb<Yb;Fb++)Sb=kc[Fb],qa=3*Fb,Ub[qa]=
|
|
l.colorsNeedUpdate||l.lineDistancesNeedUpdate||q){var eb=l,Rb=m.DYNAMIC_DRAW,Fb=void 0,Gb=void 0,Hb=void 0,Sb=void 0,qa=void 0,Tb=void 0,kc=eb.vertices,lc=eb.colors,mc=eb.lineDistances,Yb=kc.length,Zb=lc.length,$b=mc.length,Ub=eb.__vertexArray,Vb=eb.__colorArray,nc=eb.__lineDistanceArray,ac=eb.colorsNeedUpdate,bc=eb.lineDistancesNeedUpdate,fc=eb.__webglCustomAttributesList,Wb=void 0,oc=void 0,Ia=void 0,Ab=void 0,Ua=void 0,na=void 0;if(eb.verticesNeedUpdate){for(Fb=0;Fb<Yb;Fb++)Sb=kc[Fb],qa=3*Fb,Ub[qa]=
|
|
|
Sb.x,Ub[qa+1]=Sb.y,Ub[qa+2]=Sb.z;m.bindBuffer(m.ARRAY_BUFFER,eb.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,Ub,Rb)}if(ac){for(Gb=0;Gb<Zb;Gb++)Tb=lc[Gb],qa=3*Gb,Vb[qa]=Tb.r,Vb[qa+1]=Tb.g,Vb[qa+2]=Tb.b;m.bindBuffer(m.ARRAY_BUFFER,eb.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,Vb,Rb)}if(bc){for(Hb=0;Hb<$b;Hb++)nc[Hb]=mc[Hb];m.bindBuffer(m.ARRAY_BUFFER,eb.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,nc,Rb)}if(fc)for(Wb=0,oc=fc.length;Wb<oc;Wb++)if(na=fc[Wb],na.needsUpdate&&(void 0===
|
|
Sb.x,Ub[qa+1]=Sb.y,Ub[qa+2]=Sb.z;m.bindBuffer(m.ARRAY_BUFFER,eb.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,Ub,Rb)}if(ac){for(Gb=0;Gb<Zb;Gb++)Tb=lc[Gb],qa=3*Gb,Vb[qa]=Tb.r,Vb[qa+1]=Tb.g,Vb[qa+2]=Tb.b;m.bindBuffer(m.ARRAY_BUFFER,eb.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,Vb,Rb)}if(bc){for(Hb=0;Hb<$b;Hb++)nc[Hb]=mc[Hb];m.bindBuffer(m.ARRAY_BUFFER,eb.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,nc,Rb)}if(fc)for(Wb=0,oc=fc.length;Wb<oc;Wb++)if(na=fc[Wb],na.needsUpdate&&(void 0===
|
|
@@ -499,11 +499,11 @@ m.getError()+"]"),console.error("Program Info Log: "+m.getProgramInfoLog(x)));m.
|
|
|
for(A=0;A<c.maxMorphTargets;A++)v.push("morphTarget"+A);for(A=0;A<c.maxMorphNormals;A++)v.push("morphNormal"+A);for(l in b)v.push(l);l=v;A=0;for(b=l.length;A<b;A++)v=l[A],x.attributes[v]=m.getAttribLocation(x,v);x.id=ma++;R.push({program:x,code:r,usedTimes:1});M.info.memory.programs=R.length;l=x}a.program=l;A=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,b="morphTarget",l=0;l<this.maxMorphTargets;l++)x=b+l,0<=A[x]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=
|
|
for(A=0;A<c.maxMorphTargets;A++)v.push("morphTarget"+A);for(A=0;A<c.maxMorphNormals;A++)v.push("morphNormal"+A);for(l in b)v.push(l);l=v;A=0;for(b=l.length;A<b;A++)v=l[A],x.attributes[v]=m.getAttribLocation(x,v);x.id=ma++;R.push({program:x,code:r,usedTimes:1});M.info.memory.programs=R.length;l=x}a.program=l;A=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,b="morphTarget",l=0;l<this.maxMorphTargets;l++)x=b+l,0<=A[x]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=
|
|
|
0,b="morphNormal",l=0;l<this.maxMorphNormals;l++)x=b+l,0<=A[x]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===
|
|
0,b="morphNormal",l=0;l<this.maxMorphNormals;l++)x=b+l,0<=A[x]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===
|
|
|
THREE.DoubleSide;a=a.side===THREE.BackSide;va!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),va=b);wa!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),wa=a)};this.setDepthTest=function(a){Ma!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),Ma=a)};this.setDepthWrite=function(a){Ra!==a&&(m.depthMask(a),Ra=a)};this.setBlending=function(a,b,c,d){a!==Qa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):
|
|
THREE.DoubleSide;a=a.side===THREE.BackSide;va!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),va=b);wa!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),wa=a)};this.setDepthTest=function(a){Ma!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),Ma=a)};this.setDepthWrite=function(a){Ra!==a&&(m.depthMask(a),Ra=a)};this.setBlending=function(a,b,c,d){a!==Qa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):
|
|
|
-a===THREE.SubtractiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Qa=a);if(a===THREE.CustomBlending){if(b!==Da&&(m.blendEquation(D(b)),Da=b),c!==Xa||
|
|
|
|
|
-d!==Za)m.blendFunc(D(c),D(d)),Xa=c,Za=d}else Za=Xa=Da=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",tb),a.__webglTexture=m.createTexture(),M.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&
|
|
|
|
|
-THREE.Math.isPowerOfTwo(c.height),e=D(a.format),f=D(a.type);y(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):
|
|
|
|
|
|
|
+a===THREE.SubtractiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Qa=a);if(a===THREE.CustomBlending){if(b!==Da&&(m.blendEquation(C(b)),Da=b),c!==Xa||
|
|
|
|
|
+d!==Za)m.blendFunc(C(c),C(d)),Xa=c,Za=d}else Za=Xa=Da=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",tb),a.__webglTexture=m.createTexture(),M.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&
|
|
|
|
|
+THREE.Math.isPowerOfTwo(c.height),e=C(a.format),f=C(a.type);y(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):
|
|
|
m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===
|
|
m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===
|
|
|
-a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Mb);a.__webglTexture=m.createTexture();M.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=D(a.format),e=D(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);y(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();
|
|
|
|
|
|
|
+a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Mb);a.__webglTexture=m.createTexture();M.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=C(a.format),e=C(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);y(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();
|
|
|
m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);N(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),
|
|
m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);N(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),
|
|
|
y(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):
|
|
y(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):
|
|
|
N(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Aa,a=Ba,d=Fa,e=pa);b!==Ka&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Ka=b);$a=c;Na=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);
|
|
N(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Aa,a=Ba,d=Fa,e=pa);b!==Ka&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Ka=b);$a=c;Na=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);
|
|
@@ -532,7 +532,7 @@ String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this
|
|
|
c+d;n=b[a++]*c;u=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(u,t,k,n);if(g=f[f.length-1])for(q=g.x,s=g.y,g=1,h=this.divisions;g<=h;g++){var r=g/h;THREE.Shape.Utils.b2(r,q,u,k);THREE.Shape.Utils.b2(r,s,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,u=b[a++]*c+d,t=b[a++]*-c,p=b[a++]*c+d,v=b[a++]*-c,e.bezierCurveTo(k,n,u,t,p,v),g=f[f.length-1])for(q=g.x,s=g.y,g=1,h=this.divisions;g<=h;g++)r=g/h,THREE.Shape.Utils.b3(r,q,u,p,k),THREE.Shape.Utils.b3(r,s,t,v,n)}return{offset:w.ha*c,path:e}}}};
|
|
c+d;n=b[a++]*c;u=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(u,t,k,n);if(g=f[f.length-1])for(q=g.x,s=g.y,g=1,h=this.divisions;g<=h;g++){var r=g/h;THREE.Shape.Utils.b2(r,q,u,k);THREE.Shape.Utils.b2(r,s,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,u=b[a++]*c+d,t=b[a++]*-c,p=b[a++]*c+d,v=b[a++]*-c,e.bezierCurveTo(k,n,u,t,p,v),g=f[f.length-1])for(q=g.x,s=g.y,g=1,h=this.divisions;g<=h;g++)r=g/h,THREE.Shape.Utils.b3(r,q,u,p,k),THREE.Shape.Utils.b3(r,s,t,v,n)}return{offset:w.ha*c,path:e}}}};
|
|
|
THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
|
|
THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
|
|
|
(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var s;a:{var u=s=void 0,t=void 0,p=void 0,v=void 0,w=void 0,r=void 0,x=void 0,A=
|
|
(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var s;a:{var u=s=void 0,t=void 0,p=void 0,v=void 0,w=void 0,r=void 0,x=void 0,A=
|
|
|
-void 0,u=a[g[k]].x,t=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,r=a[g[n]].y;if(1E-10>(p-u)*(r-t)-(v-t)*(w-u))s=!1;else{var G=void 0,P=void 0,I=void 0,C=void 0,B=void 0,L=void 0,H=void 0,J=void 0,y=void 0,N=void 0,y=J=H=A=x=void 0,G=w-p,P=r-v,I=u-w,C=t-r,B=p-u,L=v-t;for(s=0;s<e;s++)if(x=a[g[s]].x,A=a[g[s]].y,!(x===u&&A===t||x===p&&A===v||x===w&&A===r)&&(H=x-u,J=A-t,y=x-p,N=A-v,x-=w,A-=r,y=G*N-P*y,H=B*J-L*H,J=I*A-C*x,-1E-10<=y&&-1E-10<=J&&-1E-10<=H)){s=!1;break a}s=!0}}if(s){f.push([a[g[k]],a[g[l]],
|
|
|
|
|
|
|
+void 0,u=a[g[k]].x,t=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,r=a[g[n]].y;if(1E-10>(p-u)*(r-t)-(v-t)*(w-u))s=!1;else{var F=void 0,P=void 0,I=void 0,z=void 0,B=void 0,L=void 0,H=void 0,J=void 0,y=void 0,N=void 0,y=J=H=A=x=void 0,F=w-p,P=r-v,I=u-w,z=t-r,B=p-u,L=v-t;for(s=0;s<e;s++)if(x=a[g[s]].x,A=a[g[s]].y,!(x===u&&A===t||x===p&&A===v||x===w&&A===r)&&(H=x-u,J=A-t,y=x-p,N=A-v,x-=w,A-=r,y=F*N-P*y,H=B*J-L*H,J=I*A-z*x,-1E-10<=y&&-1E-10<=J&&-1E-10<=H)){s=!1;break a}s=!0}}if(s){f.push([a[g[k]],a[g[l]],
|
|
|
a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
|
|
a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
|
|
|
THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
|
|
THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
|
|
|
THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
|
|
THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
|
|
@@ -562,11 +562,11 @@ THREE.PathActions.MOVE_TO&&0!=h.actions.length&&(g.push(h),h=new THREE.Path),h[e
|
|
|
p:u},h[s].s.actions=l.actions,h[s].s.curves=l.curves,q&&s++,e[s]=[]):e[s].push({h:l,p:u[0]});if(1<h.length){c=!1;d=[];a=0;for(g=h.length;a<g;a++)n[a]=[];a=0;for(g=h.length;a<g;a++)for(l=e[a],k=0;k<l.length;k++){q=l[k];s=!0;for(u=0;u<h.length;u++)b(q.p,h[u].p)&&(a!=u&&d.push({froms:a,tos:u,hole:k}),s?(s=!1,n[u].push(q)):c=!0);s&&n[a].push(q)}0<d.length&&(c||(e=n))}c=0;for(d=h.length;c<d;c++)for(n=h[c].s,f.push(n),a=e[c],g=0,l=a.length;g<l;g++)n.holes.push(a[g].h);return f};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);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){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};
|
|
p:u},h[s].s.actions=l.actions,h[s].s.curves=l.curves,q&&s++,e[s]=[]):e[s].push({h:l,p:u[0]});if(1<h.length){c=!1;d=[];a=0;for(g=h.length;a<g;a++)n[a]=[];a=0;for(g=h.length;a<g;a++)for(l=e[a],k=0;k<l.length;k++){q=l[k];s=!0;for(u=0;u<h.length;u++)b(q.p,h[u].p)&&(a!=u&&d.push({froms:a,tos:u,hole:k}),s?(s=!1,n[u].push(q)):c=!0);s&&n[a].push(q)}0<d.length&&(c||(e=n))}c=0;for(d=h.length;c<d;c++)for(n=h[c].s,f.push(n),a=e[c],g=0,l=a.length;g<l;g++)n.holes.push(a[g].h);return f};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);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){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};
|
|
|
THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};
|
|
THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};
|
|
|
THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
|
|
THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
|
|
|
-THREE.Shape.Utils={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,n=a.x-d.x,q=a.y-d.y,I=h*k-g*l,C=h*n-g*q;if(1E-10<Math.abs(I)){if(0<I){if(0>C||C>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0<C||C<I)return[];k=l*n-k*q;if(0<k||k<I)return[]}if(0==k)return!f||0!=C&&C!=I?[a]:[];if(k==I)return!f||0!=C&&C!=I?[b]:[];if(0==C)return[d];
|
|
|
|
|
-if(C==I)return[e];f=k/I;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=C||l*n!=k*q)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,I=d.x,l=e,d=e.x):(b=e,I=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,I=d.y,l=e,d=e.y):(b=e,I=e.y,l=d,d=d.y));return k<=I?a<I?[]:a==I?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
|
|
|
|
|
|
|
+THREE.Shape.Utils={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,n=a.x-d.x,q=a.y-d.y,I=h*k-g*l,z=h*n-g*q;if(1E-10<Math.abs(I)){if(0<I){if(0>z||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0<z||z<I)return[];k=l*n-k*q;if(0<k||k<I)return[]}if(0==k)return!f||0!=z&&z!=I?[a]:[];if(k==I)return!f||0!=z&&z!=I?[b]:[];if(0==z)return[d];
|
|
|
|
|
+if(z==I)return[e];f=k/I;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=z||l*n!=k*q)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,I=d.x,l=e,d=e.x):(b=e,I=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,I=d.y,l=e,d=e.y):(b=e,I=e.y,l=d,d=d.y));return k<=I?a<I?[]:a==I?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 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();for(f in b)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&console.log("Duplicate point",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;
|
|
[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 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();for(f in b)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&console.log("Duplicate point",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;
|
|
|
-f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,q,P,I,C,B,L,H=[],J,y;for(I in b)l.push(I);for(var N=2*l.length;0<l.length;){N--;if(0>N){console.log("Infinite Loop! Holes left:"+
|
|
|
|
|
-l.length+", Probably Hole outside Shape!");break}for(q=0;q<h.length;q++){P=h[q];n=-1;for(I=0;I<l.length;I++)if(C=l[I],L=P.x+":"+P.y+":"+C,void 0===H[L]){k=b[C];for(C=0;C<k.length;C++)if(B=k[C],c(q,C)&&!f(P,B)&&!g(P,B)){n=C;l.splice(I,1);C=h.slice(0,q+1);B=h.slice(q);J=k.slice(n);y=k.slice(0,n+1);h=C.concat(J).concat(y).concat(B);break}if(0<=n)break;H[L]=!0}if(0<=n)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=
|
|
|
|
|
|
|
+f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,q,P,I,z,B,L,H=[],J,y;for(I in b)l.push(I);for(var N=2*l.length;0<l.length;){N--;if(0>N){console.log("Infinite Loop! Holes left:"+
|
|
|
|
|
+l.length+", Probably Hole outside Shape!");break}for(q=0;q<h.length;q++){P=h[q];n=-1;for(I=0;I<l.length;I++)if(z=l[I],L=P.x+":"+P.y+":"+z,void 0===H[L]){k=b[z];for(z=0;z<k.length;z++)if(B=k[z],c(q,z)&&!f(P,B)&&!g(P,B)){n=z;l.splice(I,1);z=h.slice(0,q+1);B=h.slice(q);J=k.slice(n);y=k.slice(0,n+1);h=z.concat(J).concat(y).concat(B);break}if(0<=n)break;H[L]=!0}if(0<=n)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=
|
|
|
n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
|
|
n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
|
|
|
b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);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.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
|
|
b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);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.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
|
|
|
THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
|
|
THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
|
|
@@ -602,22 +602,22 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
|
|
|
THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())};
|
|
THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())};
|
|
|
THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
|
THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
|
-THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,r=h.heightSegments,x=e/2,A=f/2,G=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",r=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var P=w+1,I=r+1,C=e/w,B=f/r,L=new THREE.Vector3;L[v]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<P;f++){var H=new THREE.Vector3;H[a]=(f*C-x)*c;H[b]=(e*B-A)*d;H[v]=g;h.vertices.push(H)}for(e=
|
|
|
|
|
-0;e<r;e++)for(f=0;f<w;f++)A=f+P*e,a=f+P*(e+1),b=f+1+P*(e+1),c=f+1+P*e,d=new THREE.Vector2(f/w,1-e/r),g=new THREE.Vector2(f/w,1-(e+1)/r),v=new THREE.Vector2((f+1)/w,1-(e+1)/r),x=new THREE.Vector2((f+1)/w,1-e/r),A=new THREE.Face3(A+G,a+G,c+G),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),A.materialIndex=p,h.faces.push(A),h.faceVertexUvs[0].push([d,g,x]),A=new THREE.Face3(a+G,b+G,c+G),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),A.materialIndex=p,h.faces.push(A),
|
|
|
|
|
|
|
+THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,r=h.heightSegments,x=e/2,A=f/2,F=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",r=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var P=w+1,I=r+1,z=e/w,B=f/r,L=new THREE.Vector3;L[v]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<P;f++){var H=new THREE.Vector3;H[a]=(f*z-x)*c;H[b]=(e*B-A)*d;H[v]=g;h.vertices.push(H)}for(e=
|
|
|
|
|
+0;e<r;e++)for(f=0;f<w;f++)A=f+P*e,a=f+P*(e+1),b=f+1+P*(e+1),c=f+1+P*e,d=new THREE.Vector2(f/w,1-e/r),g=new THREE.Vector2(f/w,1-(e+1)/r),v=new THREE.Vector2((f+1)/w,1-(e+1)/r),x=new THREE.Vector2((f+1)/w,1-e/r),A=new THREE.Face3(A+F,a+F,c+F),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),A.materialIndex=p,h.faces.push(A),h.faceVertexUvs[0].push([d,g,x]),A=new THREE.Face3(a+F,b+F,c+F),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),A.materialIndex=p,h.faces.push(A),
|
|
|
h.faceVertexUvs[0].push([g.clone(),v,x.clone()])}THREE.Geometry.call(this);var h=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;a=this.width/2;b=this.height/2;c=this.depth/2;g("z","y",-1,-1,this.depth,this.height,a,0);g("z","y",1,-1,this.depth,this.height,-a,1);g("x","z",1,1,this.width,this.depth,b,2);g("x","z",1,-1,this.width,this.depth,-b,3);g("x","y",1,-1,this.width,this.height,c,4);g("x","y",-1,-1,this.width,this.height,-c,
|
|
h.faceVertexUvs[0].push([g.clone(),v,x.clone()])}THREE.Geometry.call(this);var h=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;a=this.width/2;b=this.height/2;c=this.depth/2;g("z","y",-1,-1,this.depth,this.height,a,0);g("z","y",1,-1,this.depth,this.height,-a,1);g("x","z",1,1,this.width,this.depth,b,2);g("x","z",1,-1,this.width,this.depth,-b,3);g("x","y",1,-1,this.width,this.height,c,4);g("x","y",-1,-1,this.width,this.height,-c,
|
|
|
5);this.computeCentroids();this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a=a||50;this.segments=b=void 0!==b?Math.max(3,b):8;this.thetaStart=c=void 0!==c?c:0;this.thetaLength=d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,
|
|
5);this.computeCentroids();this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a=a||50;this.segments=b=void 0!==b?Math.max(3,b):8;this.thetaStart=c=void 0!==c?c:0;this.thetaLength=d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,
|
|
|
e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=THREE.BoxGeometry;THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var q=[],s=[],u=k/e,t=u*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=t*Math.sin(p*Math.PI*2);v.y=-u*c+g;v.z=t*Math.cos(p*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);s.push(new THREE.Vector2(p,
|
|
e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=THREE.BoxGeometry;THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var q=[],s=[],u=k/e,t=u*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=t*Math.sin(p*Math.PI*2);v.y=-u*c+g;v.z=t*Math.cos(p*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);s.push(new THREE.Vector2(p,
|
|
|
-1-u))}l.push(q);n.push(s)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),s=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),s=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*c).normalize(),k=0;k<e;k++){var u=l[k][h],t=l[k+1][h],p=l[k+1][h+1],v=l[k][h+1],w=q.clone(),r=q.clone(),x=s.clone(),A=s.clone(),G=n[k][h].clone(),P=n[k+1][h].clone(),I=n[k+1][h+1].clone(),C=n[k][h+1].clone();this.faces.push(new THREE.Face3(u,
|
|
|
|
|
-t,v,[w,r,A]));this.faceVertexUvs[0].push([G,P,C]);this.faces.push(new THREE.Face3(t,p,v,[r.clone(),x,A.clone()]));this.faceVertexUvs[0].push([P.clone(),I,C.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)u=l[0][h],t=l[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),G=n[0][h].clone(),P=n[0][h+1].clone(),I=new THREE.Vector2(P.x,0),this.faces.push(new THREE.Face3(u,t,p,[w,r,x])),this.faceVertexUvs[0].push([G,
|
|
|
|
|
-P,I]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)u=l[k][h+1],t=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),r=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),G=n[k][h+1].clone(),P=n[k][h].clone(),I=new THREE.Vector2(P.x,1),this.faces.push(new THREE.Face3(u,t,p,[w,r,x])),this.faceVertexUvs[0].push([G,P,I]);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);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.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else 0!=e&&d(e)!=d(g)||0==e&&d(f)!=d(h)?(c=e,a=f,e=
|
|
|
|
|
-Math.sqrt(k/2)):(c=-f,a=e,e=Math.sqrt(k));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(Q=c.length;0<=--Q;){e=Q;f=Q-1;0>f&&(f=c.length-1);for(var g=0,h=u+2*n,g=0;g<h;g++){var k=ea*g,l=ea*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,s=c,t=g,v=h,w=e,y=f,p=p+J,k=k+J,q=q+J,l=l+J;H.faces.push(new THREE.Face3(p,k,l,null,null,r));H.faces.push(new THREE.Face3(k,q,l,null,null,r));p=x.generateSideWallUV(H,a,s,b,p,k,q,l,t,v,w,y);H.faceVertexUvs[0].push([p[0],p[1],p[3]]);H.faceVertexUvs[0].push([p[1],
|
|
|
|
|
-p[2],p[3]])}}}function f(a,b,c){H.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=J;d+=J;e+=J;H.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?x.generateBottomUV(H,a,b,c,d,e):x.generateTopUV(H,a,b,c,d,e);H.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,s=void 0!==b.curveSegments?b.curveSegments:
|
|
|
|
|
-12,u=void 0!==b.steps?b.steps:1,t=b.extrudePath,p,v=!1,w=b.material,r=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,A,G,P,I;t&&(p=t.getSpacedPoints(u),v=!0,q=!1,A=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,u,!1),G=new THREE.Vector3,P=new THREE.Vector3,I=new THREE.Vector3);q||(l=k=n=0);var C,B,L,H=this,J=this.vertices.length,t=a.extractPoints(s),s=t.shape,y=t.holes;if(t=!THREE.Shape.Utils.isClockWise(s)){s=s.reverse();B=0;for(L=
|
|
|
|
|
-y.length;B<L;B++)C=y[B],THREE.Shape.Utils.isClockWise(C)&&(y[B]=C.reverse());t=!1}var N=THREE.Shape.Utils.triangulateShape(s,y),z=s;B=0;for(L=y.length;B<L;B++)C=y[B],s=s.concat(C);var D,E,F,X,T,ea=s.length,Y,la=N.length,t=[],Q=0;F=z.length;D=F-1;for(E=Q+1;Q<F;Q++,D++,E++)D===F&&(D=0),E===F&&(E=0),t[Q]=d(z[Q],z[D],z[E]);var ha=[],S,M=t.concat();B=0;for(L=y.length;B<L;B++){C=y[B];S=[];Q=0;F=C.length;D=F-1;for(E=Q+1;Q<F;Q++,D++,E++)D===F&&(D=0),E===F&&(E=0),S[Q]=d(C[Q],C[D],C[E]);ha.push(S);M=M.concat(S)}for(D=
|
|
|
|
|
-0;D<n;D++){F=D/n;X=k*(1-F);E=l*Math.sin(F*Math.PI/2);Q=0;for(F=z.length;Q<F;Q++)T=c(z[Q],t[Q],E),f(T.x,T.y,-X);B=0;for(L=y.length;B<L;B++)for(C=y[B],S=ha[B],Q=0,F=C.length;Q<F;Q++)T=c(C[Q],S[Q],E),f(T.x,T.y,-X)}E=l;for(Q=0;Q<ea;Q++)T=q?c(s[Q],M[Q],E):s[Q],v?(P.copy(A.normals[0]).multiplyScalar(T.x),G.copy(A.binormals[0]).multiplyScalar(T.y),I.copy(p[0]).add(P).add(G),f(I.x,I.y,I.z)):f(T.x,T.y,0);for(F=1;F<=u;F++)for(Q=0;Q<ea;Q++)T=q?c(s[Q],M[Q],E):s[Q],v?(P.copy(A.normals[F]).multiplyScalar(T.x),
|
|
|
|
|
-G.copy(A.binormals[F]).multiplyScalar(T.y),I.copy(p[F]).add(P).add(G),f(I.x,I.y,I.z)):f(T.x,T.y,h/u*F);for(D=n-1;0<=D;D--){F=D/n;X=k*(1-F);E=l*Math.sin(F*Math.PI/2);Q=0;for(F=z.length;Q<F;Q++)T=c(z[Q],t[Q],E),f(T.x,T.y,h+X);B=0;for(L=y.length;B<L;B++)for(C=y[B],S=ha[B],Q=0,F=C.length;Q<F;Q++)T=c(C[Q],S[Q],E),v?f(T.x,T.y+p[u-1].y,p[u-1].x+X):f(T.x,T.y,h+X)}(function(){if(q){var a;a=0*ea;for(Q=0;Q<la;Q++)Y=N[Q],g(Y[2]+a,Y[1]+a,Y[0]+a,!0);a=u+2*n;a*=ea;for(Q=0;Q<la;Q++)Y=N[Q],g(Y[0]+a,Y[1]+a,Y[2]+a,
|
|
|
|
|
-!1)}else{for(Q=0;Q<la;Q++)Y=N[Q],g(Y[2],Y[1],Y[0],!0);for(Q=0;Q<la;Q++)Y=N[Q],g(Y[0]+ea*u,Y[1]+ea*u,Y[2]+ea*u,!1)}})();(function(){var a=0;e(z,a);a+=z.length;B=0;for(L=y.length;B<L;B++)C=y[B],e(C,a),a+=C.length})()};
|
|
|
|
|
|
|
+1-u))}l.push(q);n.push(s)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),s=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),s=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*c).normalize(),k=0;k<e;k++){var u=l[k][h],t=l[k+1][h],p=l[k+1][h+1],v=l[k][h+1],w=q.clone(),r=q.clone(),x=s.clone(),A=s.clone(),F=n[k][h].clone(),P=n[k+1][h].clone(),I=n[k+1][h+1].clone(),z=n[k][h+1].clone();this.faces.push(new THREE.Face3(u,
|
|
|
|
|
+t,v,[w,r,A]));this.faceVertexUvs[0].push([F,P,z]);this.faces.push(new THREE.Face3(t,p,v,[r.clone(),x,A.clone()]));this.faceVertexUvs[0].push([P.clone(),I,z.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)u=l[0][h],t=l[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),F=n[0][h].clone(),P=n[0][h+1].clone(),I=new THREE.Vector2(P.x,0),this.faces.push(new THREE.Face3(u,t,p,[w,r,x])),this.faceVertexUvs[0].push([F,
|
|
|
|
|
+P,I]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)u=l[k][h+1],t=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),r=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),F=n[k][h+1].clone(),P=n[k][h].clone(),I=new THREE.Vector2(P.x,1),this.faces.push(new THREE.Face3(u,t,p,[w,r,x])),this.faceVertexUvs[0].push([F,P,I]);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);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.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&
|
|
|
|
|
+(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(Q=c.length;0<=--Q;){e=Q;f=Q-1;0>f&&(f=c.length-1);for(var g=0,h=u+2*n,g=0;g<h;g++){var k=ea*g,l=ea*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,s=c,t=g,v=h,w=e,y=f,p=p+J,k=k+J,q=q+J,l=l+J;H.faces.push(new THREE.Face3(p,k,l,null,null,r));H.faces.push(new THREE.Face3(k,q,l,null,null,r));p=x.generateSideWallUV(H,a,s,b,p,k,q,l,t,v,w,y);H.faceVertexUvs[0].push([p[0],p[1],
|
|
|
|
|
+p[3]]);H.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){H.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=J;d+=J;e+=J;H.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?x.generateBottomUV(H,a,b,c,d,e):x.generateTopUV(H,a,b,c,d,e);H.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,s=
|
|
|
|
|
+void 0!==b.curveSegments?b.curveSegments:12,u=void 0!==b.steps?b.steps:1,t=b.extrudePath,p,v=!1,w=b.material,r=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,A,F,P,I;t&&(p=t.getSpacedPoints(u),v=!0,q=!1,A=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,u,!1),F=new THREE.Vector3,P=new THREE.Vector3,I=new THREE.Vector3);q||(l=k=n=0);var z,B,L,H=this,J=this.vertices.length,t=a.extractPoints(s),s=t.shape,y=t.holes;if(t=!THREE.Shape.Utils.isClockWise(s)){s=
|
|
|
|
|
+s.reverse();B=0;for(L=y.length;B<L;B++)z=y[B],THREE.Shape.Utils.isClockWise(z)&&(y[B]=z.reverse());t=!1}var N=THREE.Shape.Utils.triangulateShape(s,y),E=s;B=0;for(L=y.length;B<L;B++)z=y[B],s=s.concat(z);var C,D,G,X,T,ea=s.length,Y,la=N.length,t=[],Q=0;G=E.length;C=G-1;for(D=Q+1;Q<G;Q++,C++,D++)C===G&&(C=0),D===G&&(D=0),t[Q]=d(E[Q],E[C],E[D]);var ha=[],S,M=t.concat();B=0;for(L=y.length;B<L;B++){z=y[B];S=[];Q=0;G=z.length;C=G-1;for(D=Q+1;Q<G;Q++,C++,D++)C===G&&(C=0),D===G&&(D=0),S[Q]=d(z[Q],z[C],z[D]);
|
|
|
|
|
+ha.push(S);M=M.concat(S)}for(C=0;C<n;C++){G=C/n;X=k*(1-G);D=l*Math.sin(G*Math.PI/2);Q=0;for(G=E.length;Q<G;Q++)T=c(E[Q],t[Q],D),f(T.x,T.y,-X);B=0;for(L=y.length;B<L;B++)for(z=y[B],S=ha[B],Q=0,G=z.length;Q<G;Q++)T=c(z[Q],S[Q],D),f(T.x,T.y,-X)}D=l;for(Q=0;Q<ea;Q++)T=q?c(s[Q],M[Q],D):s[Q],v?(P.copy(A.normals[0]).multiplyScalar(T.x),F.copy(A.binormals[0]).multiplyScalar(T.y),I.copy(p[0]).add(P).add(F),f(I.x,I.y,I.z)):f(T.x,T.y,0);for(G=1;G<=u;G++)for(Q=0;Q<ea;Q++)T=q?c(s[Q],M[Q],D):s[Q],v?(P.copy(A.normals[G]).multiplyScalar(T.x),
|
|
|
|
|
+F.copy(A.binormals[G]).multiplyScalar(T.y),I.copy(p[G]).add(P).add(F),f(I.x,I.y,I.z)):f(T.x,T.y,h/u*G);for(C=n-1;0<=C;C--){G=C/n;X=k*(1-G);D=l*Math.sin(G*Math.PI/2);Q=0;for(G=E.length;Q<G;Q++)T=c(E[Q],t[Q],D),f(T.x,T.y,h+X);B=0;for(L=y.length;B<L;B++)for(z=y[B],S=ha[B],Q=0,G=z.length;Q<G;Q++)T=c(z[Q],S[Q],D),v?f(T.x,T.y+p[u-1].y,p[u-1].x+X):f(T.x,T.y,h+X)}(function(){if(q){var a;a=0*ea;for(Q=0;Q<la;Q++)Y=N[Q],g(Y[2]+a,Y[1]+a,Y[0]+a,!0);a=u+2*n;a*=ea;for(Q=0;Q<la;Q++)Y=N[Q],g(Y[0]+a,Y[1]+a,Y[2]+a,
|
|
|
|
|
+!1)}else{for(Q=0;Q<la;Q++)Y=N[Q],g(Y[2],Y[1],Y[0],!0);for(Q=0;Q<la;Q++)Y=N[Q],g(Y[0]+ea*u,Y[1]+ea*u,Y[2]+ea*u,!1)}})();(function(){var a=0;e(E,a);a+=E.length;B=0;for(L=y.length;B<L;B++)z=y[B],e(z,a),a+=z.length})()};
|
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;
|
|
|
n=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var s=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(s,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
|
|
n=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var s=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(s,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
|
|
|
THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);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.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
|
|
@@ -682,29 +682,29 @@ f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetI
|
|
|
e[t++]=0;e[t++]=0;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;t=0;f[t++]=0;f[t++]=1;f[t++]=2;f[t++]=0;f[t++]=2;f[t++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);k=b.createTexture();l=b.createTexture();b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
|
|
e[t++]=0;e[t++]=0;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;t=0;f[t++]=0;f[t++]=1;f[t++]=2;f[t++]=0;f[t++]=2;f[t++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);k=b.createTexture();l=b.createTexture();b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
|
|
|
0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,l);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
|
|
0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,l);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
|
|
|
b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(n=!1,q=a(THREE.ShaderFlares.lensFlare,d)):(n=!0,q=a(THREE.ShaderFlares.lensFlareVertexTexture,d));s={};u={};s.vertex=b.getAttribLocation(q,"position");s.uv=b.getAttribLocation(q,"uv");u.renderType=b.getUniformLocation(q,"renderType");u.map=b.getUniformLocation(q,"map");u.occlusionMap=b.getUniformLocation(q,"occlusionMap");u.opacity=
|
|
b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(n=!1,q=a(THREE.ShaderFlares.lensFlare,d)):(n=!0,q=a(THREE.ShaderFlares.lensFlareVertexTexture,d));s={};u={};s.vertex=b.getAttribLocation(q,"position");s.uv=b.getAttribLocation(q,"uv");u.renderType=b.getUniformLocation(q,"renderType");u.map=b.getUniformLocation(q,"map");u.occlusionMap=b.getUniformLocation(q,"occlusionMap");u.opacity=
|
|
|
-b.getUniformLocation(q,"opacity");u.color=b.getUniformLocation(q,"color");u.scale=b.getUniformLocation(q,"scale");u.rotation=b.getUniformLocation(q,"rotation");u.screenPosition=b.getUniformLocation(q,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var r=a.length;if(r){var x=new THREE.Vector3,A=f/e,G=0.5*e,P=0.5*f,I=16/f,C=new THREE.Vector2(I*A,I),B=new THREE.Vector3(1,1,0),L=new THREE.Vector2(1,1),H=u,I=s;b.useProgram(q);b.enableVertexAttribArray(s.vertex);b.enableVertexAttribArray(s.uv);
|
|
|
|
|
-b.uniform1i(H.occlusionMap,0);b.uniform1i(H.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(I.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(I.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var J,y,N,z,D;for(J=0;J<r;J++)if(I=16/f,C.set(I*A,I),z=a[J],x.set(z.matrixWorld.elements[12],z.matrixWorld.elements[13],z.matrixWorld.elements[14]),x.applyMatrix4(d.matrixWorldInverse),x.applyProjection(d.projectionMatrix),B.copy(x),L.x=B.x*G+G,
|
|
|
|
|
-L.y=B.y*P+P,n||0<L.x&&L.x<e&&0<L.y&&L.y<f)for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,L.x-8,L.y-8,16,16,0),b.uniform1i(H.renderType,0),b.uniform2f(H.scale,C.x,C.y),b.uniform3f(H.screenPosition,B.x,B.y,B.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,L.x-8,L.y-8,16,16,0),b.uniform1i(H.renderType,1),b.disable(b.DEPTH_TEST),
|
|
|
|
|
-b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),z.positionScreen.copy(B),z.customUpdateCallback?z.customUpdateCallback(z):z.updateLensFlares(),b.uniform1i(H.renderType,2),b.enable(b.BLEND),y=0,N=z.lensFlares.length;y<N;y++)D=z.lensFlares[y],0.001<D.opacity&&0.001<D.scale&&(B.x=D.x,B.y=D.y,B.z=D.z,I=D.size*D.scale/f,C.x=I*A,C.y=I,b.uniform3f(H.screenPosition,B.x,B.y,B.z),b.uniform2f(H.scale,C.x,C.y),b.uniform1f(H.rotation,D.rotation),b.uniform1f(H.opacity,
|
|
|
|
|
-D.opacity),b.uniform3f(H.color,D.color.r,D.color.g,D.color.b),c.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst),c.setTexture(D.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
|
|
|
|
|
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(q,s){var u,t,p,v,w,r,x,A,G,P=[];v=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
|
|
|
|
|
-a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);u=0;for(t=q.__lights.length;u<t;u++)if(p=q.__lights[u],p.castShadow)if(p instanceof THREE.DirectionalLight&&p.shadowCascade)for(w=0;w<p.shadowCascadeCount;w++){var I;if(p.shadowCascadeArray[w])I=p.shadowCascadeArray[w];else{G=p;x=w;I=new THREE.DirectionalLight;I.isVirtual=!0;I.onlyShadow=!0;I.castShadow=!0;I.shadowCameraNear=G.shadowCameraNear;I.shadowCameraFar=G.shadowCameraFar;I.shadowCameraLeft=G.shadowCameraLeft;I.shadowCameraRight=G.shadowCameraRight;
|
|
|
|
|
-I.shadowCameraBottom=G.shadowCameraBottom;I.shadowCameraTop=G.shadowCameraTop;I.shadowCameraVisible=G.shadowCameraVisible;I.shadowDarkness=G.shadowDarkness;I.shadowBias=G.shadowCascadeBias[x];I.shadowMapWidth=G.shadowCascadeWidth[x];I.shadowMapHeight=G.shadowCascadeHeight[x];I.pointsWorld=[];I.pointsFrustum=[];A=I.pointsWorld;r=I.pointsFrustum;for(var C=0;8>C;C++)A[C]=new THREE.Vector3,r[C]=new THREE.Vector3;A=G.shadowCascadeNearZ[x];G=G.shadowCascadeFarZ[x];r[0].set(-1,-1,A);r[1].set(1,-1,A);r[2].set(-1,
|
|
|
|
|
-1,A);r[3].set(1,1,A);r[4].set(-1,-1,G);r[5].set(1,-1,G);r[6].set(-1,1,G);r[7].set(1,1,G);I.originalCamera=s;r=new THREE.Gyroscope;r.position=p.shadowCascadeOffset;r.add(I);r.add(I.target);s.add(r);p.shadowCascadeArray[w]=I;console.log("Created virtualLight",I)}x=p;A=w;G=x.shadowCascadeArray[A];G.position.copy(x.position);G.target.position.copy(x.target.position);G.lookAt(G.target);G.shadowCameraVisible=x.shadowCameraVisible;G.shadowDarkness=x.shadowDarkness;G.shadowBias=x.shadowCascadeBias[A];r=x.shadowCascadeNearZ[A];
|
|
|
|
|
-x=x.shadowCascadeFarZ[A];G=G.pointsFrustum;G[0].z=r;G[1].z=r;G[2].z=r;G[3].z=r;G[4].z=x;G[5].z=x;G[6].z=x;G[7].z=x;P[v]=I;v++}else P[v]=p,v++;u=0;for(t=P.length;u<t;u++){p=P[u];p.shadowMap||(w=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(w=THREE.NearestFilter),p.shadowMap=new THREE.WebGLRenderTarget(p.shadowMapWidth,p.shadowMapHeight,{minFilter:w,magFilter:w,format:THREE.RGBAFormat}),p.shadowMapSize=new THREE.Vector2(p.shadowMapWidth,p.shadowMapHeight),p.shadowMatrix=new THREE.Matrix4);
|
|
|
|
|
|
|
+b.getUniformLocation(q,"opacity");u.color=b.getUniformLocation(q,"color");u.scale=b.getUniformLocation(q,"scale");u.rotation=b.getUniformLocation(q,"rotation");u.screenPosition=b.getUniformLocation(q,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var r=a.length;if(r){var x=new THREE.Vector3,A=f/e,F=0.5*e,P=0.5*f,I=16/f,z=new THREE.Vector2(I*A,I),B=new THREE.Vector3(1,1,0),L=new THREE.Vector2(1,1),H=u,I=s;b.useProgram(q);b.enableVertexAttribArray(s.vertex);b.enableVertexAttribArray(s.uv);
|
|
|
|
|
+b.uniform1i(H.occlusionMap,0);b.uniform1i(H.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(I.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(I.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var J,y,N,E,C;for(J=0;J<r;J++)if(I=16/f,z.set(I*A,I),E=a[J],x.set(E.matrixWorld.elements[12],E.matrixWorld.elements[13],E.matrixWorld.elements[14]),x.applyMatrix4(d.matrixWorldInverse),x.applyProjection(d.projectionMatrix),B.copy(x),L.x=B.x*F+F,
|
|
|
|
|
+L.y=B.y*P+P,n||0<L.x&&L.x<e&&0<L.y&&L.y<f)for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,L.x-8,L.y-8,16,16,0),b.uniform1i(H.renderType,0),b.uniform2f(H.scale,z.x,z.y),b.uniform3f(H.screenPosition,B.x,B.y,B.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,L.x-8,L.y-8,16,16,0),b.uniform1i(H.renderType,1),b.disable(b.DEPTH_TEST),
|
|
|
|
|
+b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),E.positionScreen.copy(B),E.customUpdateCallback?E.customUpdateCallback(E):E.updateLensFlares(),b.uniform1i(H.renderType,2),b.enable(b.BLEND),y=0,N=E.lensFlares.length;y<N;y++)C=E.lensFlares[y],0.001<C.opacity&&0.001<C.scale&&(B.x=C.x,B.y=C.y,B.z=C.z,I=C.size*C.scale/f,z.x=I*A,z.y=I,b.uniform3f(H.screenPosition,B.x,B.y,B.z),b.uniform2f(H.scale,z.x,z.y),b.uniform1f(H.rotation,C.rotation),b.uniform1f(H.opacity,
|
|
|
|
|
+C.opacity),b.uniform3f(H.color,C.color.r,C.color.g,C.color.b),c.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),c.setTexture(C.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
|
|
|
|
|
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(q,s){var u,t,p,v,w,r,x,A,F,P=[];v=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
|
|
|
|
|
+a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);u=0;for(t=q.__lights.length;u<t;u++)if(p=q.__lights[u],p.castShadow)if(p instanceof THREE.DirectionalLight&&p.shadowCascade)for(w=0;w<p.shadowCascadeCount;w++){var I;if(p.shadowCascadeArray[w])I=p.shadowCascadeArray[w];else{F=p;x=w;I=new THREE.DirectionalLight;I.isVirtual=!0;I.onlyShadow=!0;I.castShadow=!0;I.shadowCameraNear=F.shadowCameraNear;I.shadowCameraFar=F.shadowCameraFar;I.shadowCameraLeft=F.shadowCameraLeft;I.shadowCameraRight=F.shadowCameraRight;
|
|
|
|
|
+I.shadowCameraBottom=F.shadowCameraBottom;I.shadowCameraTop=F.shadowCameraTop;I.shadowCameraVisible=F.shadowCameraVisible;I.shadowDarkness=F.shadowDarkness;I.shadowBias=F.shadowCascadeBias[x];I.shadowMapWidth=F.shadowCascadeWidth[x];I.shadowMapHeight=F.shadowCascadeHeight[x];I.pointsWorld=[];I.pointsFrustum=[];A=I.pointsWorld;r=I.pointsFrustum;for(var z=0;8>z;z++)A[z]=new THREE.Vector3,r[z]=new THREE.Vector3;A=F.shadowCascadeNearZ[x];F=F.shadowCascadeFarZ[x];r[0].set(-1,-1,A);r[1].set(1,-1,A);r[2].set(-1,
|
|
|
|
|
+1,A);r[3].set(1,1,A);r[4].set(-1,-1,F);r[5].set(1,-1,F);r[6].set(-1,1,F);r[7].set(1,1,F);I.originalCamera=s;r=new THREE.Gyroscope;r.position=p.shadowCascadeOffset;r.add(I);r.add(I.target);s.add(r);p.shadowCascadeArray[w]=I;console.log("Created virtualLight",I)}x=p;A=w;F=x.shadowCascadeArray[A];F.position.copy(x.position);F.target.position.copy(x.target.position);F.lookAt(F.target);F.shadowCameraVisible=x.shadowCameraVisible;F.shadowDarkness=x.shadowDarkness;F.shadowBias=x.shadowCascadeBias[A];r=x.shadowCascadeNearZ[A];
|
|
|
|
|
+x=x.shadowCascadeFarZ[A];F=F.pointsFrustum;F[0].z=r;F[1].z=r;F[2].z=r;F[3].z=r;F[4].z=x;F[5].z=x;F[6].z=x;F[7].z=x;P[v]=I;v++}else P[v]=p,v++;u=0;for(t=P.length;u<t;u++){p=P[u];p.shadowMap||(w=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(w=THREE.NearestFilter),p.shadowMap=new THREE.WebGLRenderTarget(p.shadowMapWidth,p.shadowMapHeight,{minFilter:w,magFilter:w,format:THREE.RGBAFormat}),p.shadowMapSize=new THREE.Vector2(p.shadowMapWidth,p.shadowMapHeight),p.shadowMatrix=new THREE.Matrix4);
|
|
|
if(!p.shadowCamera){if(p instanceof THREE.SpotLight)p.shadowCamera=new THREE.PerspectiveCamera(p.shadowCameraFov,p.shadowMapWidth/p.shadowMapHeight,p.shadowCameraNear,p.shadowCameraFar);else if(p instanceof THREE.DirectionalLight)p.shadowCamera=new THREE.OrthographicCamera(p.shadowCameraLeft,p.shadowCameraRight,p.shadowCameraTop,p.shadowCameraBottom,p.shadowCameraNear,p.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}q.add(p.shadowCamera);!0===q.autoUpdate&&q.updateMatrixWorld()}p.shadowCameraVisible&&
|
|
if(!p.shadowCamera){if(p instanceof THREE.SpotLight)p.shadowCamera=new THREE.PerspectiveCamera(p.shadowCameraFov,p.shadowMapWidth/p.shadowMapHeight,p.shadowCameraNear,p.shadowCameraFar);else if(p instanceof THREE.DirectionalLight)p.shadowCamera=new THREE.OrthographicCamera(p.shadowCameraLeft,p.shadowCameraRight,p.shadowCameraTop,p.shadowCameraBottom,p.shadowCameraNear,p.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}q.add(p.shadowCamera);!0===q.autoUpdate&&q.updateMatrixWorld()}p.shadowCameraVisible&&
|
|
|
-!p.cameraHelper&&(p.cameraHelper=new THREE.CameraHelper(p.shadowCamera),p.shadowCamera.add(p.cameraHelper));if(p.isVirtual&&I.originalCamera==s){w=s;v=p.shadowCamera;r=p.pointsFrustum;G=p.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(x=0;8>x;x++)A=G[x],A.copy(r[x]),THREE.ShadowMapPlugin.__projector.unprojectVector(A,w),A.applyMatrix4(v.matrixWorldInverse),A.x<k.x&&(k.x=A.x),A.x>l.x&&(l.x=A.x),A.y<k.y&&(k.y=A.y),A.y>l.y&&(l.y=A.y),A.z<k.z&&(k.z=A.z),A.z>l.z&&
|
|
|
|
|
|
|
+!p.cameraHelper&&(p.cameraHelper=new THREE.CameraHelper(p.shadowCamera),p.shadowCamera.add(p.cameraHelper));if(p.isVirtual&&I.originalCamera==s){w=s;v=p.shadowCamera;r=p.pointsFrustum;F=p.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(x=0;8>x;x++)A=F[x],A.copy(r[x]),THREE.ShadowMapPlugin.__projector.unprojectVector(A,w),A.applyMatrix4(v.matrixWorldInverse),A.x<k.x&&(k.x=A.x),A.x>l.x&&(l.x=A.x),A.y<k.y&&(k.y=A.y),A.y>l.y&&(l.y=A.y),A.z<k.z&&(k.z=A.z),A.z>l.z&&
|
|
|
(l.z=A.z);v.left=k.x;v.right=l.x;v.top=l.y;v.bottom=k.y;v.updateProjectionMatrix()}v=p.shadowMap;r=p.shadowMatrix;w=p.shadowCamera;w.position.setFromMatrixPosition(p.matrixWorld);n.setFromMatrixPosition(p.target.matrixWorld);w.lookAt(n);w.updateMatrixWorld();w.matrixWorldInverse.getInverse(w.matrixWorld);p.cameraHelper&&(p.cameraHelper.visible=p.shadowCameraVisible);p.shadowCameraVisible&&p.cameraHelper.update();r.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);r.multiply(w.projectionMatrix);r.multiply(w.matrixWorldInverse);
|
|
(l.z=A.z);v.left=k.x;v.right=l.x;v.top=l.y;v.bottom=k.y;v.updateProjectionMatrix()}v=p.shadowMap;r=p.shadowMatrix;w=p.shadowCamera;w.position.setFromMatrixPosition(p.matrixWorld);n.setFromMatrixPosition(p.target.matrixWorld);w.lookAt(n);w.updateMatrixWorld();w.matrixWorldInverse.getInverse(w.matrixWorld);p.cameraHelper&&(p.cameraHelper.visible=p.shadowCameraVisible);p.shadowCameraVisible&&p.cameraHelper.update();r.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);r.multiply(w.projectionMatrix);r.multiply(w.matrixWorldInverse);
|
|
|
-h.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(v);b.clear();G=q.__webglObjects;p=0;for(v=G.length;p<v;p++)x=G[p],r=x.object,x.render=!1,!r.visible||!r.castShadow||(r instanceof THREE.Mesh||r instanceof THREE.ParticleSystem)&&r.frustumCulled&&!g.intersectsObject(r)||(r._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,r.matrixWorld),x.render=!0);p=0;for(v=G.length;p<v;p++)x=G[p],x.render&&(r=x.object,x=x.buffer,C=r.material instanceof THREE.MeshFaceMaterial?
|
|
|
|
|
-r.material.materials[0]:r.material,A=0<r.geometry.morphTargets.length&&C.morphTargets,C=r instanceof THREE.SkinnedMesh&&C.skinning,A=r.customDepthMaterial?r.customDepthMaterial:C?A?f:e:A?d:c,x instanceof THREE.BufferGeometry?b.renderBufferDirect(w,q.__lights,null,A,x,r):b.renderBuffer(w,q.__lights,null,A,x,r));G=q.__webglObjectsImmediate;p=0;for(v=G.length;p<v;p++)x=G[p],r=x.object,r.visible&&r.castShadow&&(r._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,r.matrixWorld),b.renderImmediateObject(w,
|
|
|
|
|
-q.__lights,null,c,r))}u=b.getClearColor();t=b.getClearAlpha();a.clearColor(u.r,u.g,u.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,n,q,s,u,t,p,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var r,x,A,G,P,I,C,B;this.init=function(w){r=w.context;x=w;G=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);P=new Uint16Array([0,1,2,0,2,3]);I=r.createBuffer();C=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,I);r.bufferData(r.ARRAY_BUFFER,G,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,C);r.bufferData(r.ELEMENT_ARRAY_BUFFER,P,r.STATIC_DRAW);w=r.createProgram();
|
|
|
|
|
|
|
+h.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(v);b.clear();F=q.__webglObjects;p=0;for(v=F.length;p<v;p++)x=F[p],r=x.object,x.render=!1,!r.visible||!r.castShadow||(r instanceof THREE.Mesh||r instanceof THREE.ParticleSystem)&&r.frustumCulled&&!g.intersectsObject(r)||(r._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,r.matrixWorld),x.render=!0);p=0;for(v=F.length;p<v;p++)x=F[p],x.render&&(r=x.object,x=x.buffer,z=r.material instanceof THREE.MeshFaceMaterial?
|
|
|
|
|
+r.material.materials[0]:r.material,A=0<r.geometry.morphTargets.length&&z.morphTargets,z=r instanceof THREE.SkinnedMesh&&z.skinning,A=r.customDepthMaterial?r.customDepthMaterial:z?A?f:e:A?d:c,x instanceof THREE.BufferGeometry?b.renderBufferDirect(w,q.__lights,null,A,x,r):b.renderBuffer(w,q.__lights,null,A,x,r));F=q.__webglObjectsImmediate;p=0;for(v=F.length;p<v;p++)x=F[p],r=x.object,r.visible&&r.castShadow&&(r._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,r.matrixWorld),b.renderImmediateObject(w,
|
|
|
|
|
+q.__lights,null,c,r))}u=b.getClearColor();t=b.getClearAlpha();a.clearColor(u.r,u.g,u.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,n,q,s,u,t,p,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var r,x,A,F,P,I,z,B;this.init=function(w){r=w.context;x=w;F=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);P=new Uint16Array([0,1,2,0,2,3]);I=r.createBuffer();z=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,I);r.bufferData(r.ARRAY_BUFFER,F,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,z);r.bufferData(r.ELEMENT_ARRAY_BUFFER,P,r.STATIC_DRAW);w=r.createProgram();
|
|
|
var H=r.createShader(r.VERTEX_SHADER),J=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(H,["precision "+x.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"));
|
|
var H=r.createShader(r.VERTEX_SHADER),J=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(H,["precision "+x.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"));
|
|
|
r.shaderSource(J,["precision "+x.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;\nfloat fogFactor = 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"));
|
|
r.shaderSource(J,["precision "+x.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;\nfloat fogFactor = 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"));
|
|
|
r.compileShader(H);r.compileShader(J);r.attachShader(w,H);r.attachShader(w,J);r.linkProgram(w);B=w;p=r.getAttribLocation(B,"position");v=r.getAttribLocation(B,"uv");a=r.getUniformLocation(B,"uvOffset");b=r.getUniformLocation(B,"uvScale");c=r.getUniformLocation(B,"rotation");d=r.getUniformLocation(B,"scale");e=r.getUniformLocation(B,"color");f=r.getUniformLocation(B,"map");g=r.getUniformLocation(B,"opacity");h=r.getUniformLocation(B,"modelViewMatrix");k=r.getUniformLocation(B,"projectionMatrix");l=
|
|
r.compileShader(H);r.compileShader(J);r.attachShader(w,H);r.attachShader(w,J);r.linkProgram(w);B=w;p=r.getAttribLocation(B,"position");v=r.getAttribLocation(B,"uv");a=r.getUniformLocation(B,"uvOffset");b=r.getUniformLocation(B,"uvScale");c=r.getUniformLocation(B,"rotation");d=r.getUniformLocation(B,"scale");e=r.getUniformLocation(B,"color");f=r.getUniformLocation(B,"map");g=r.getUniformLocation(B,"opacity");h=r.getUniformLocation(B,"modelViewMatrix");k=r.getUniformLocation(B,"projectionMatrix");l=
|
|
|
-r.getUniformLocation(B,"fogType");n=r.getUniformLocation(B,"fogDensity");q=r.getUniformLocation(B,"fogNear");s=r.getUniformLocation(B,"fogFar");u=r.getUniformLocation(B,"fogColor");t=r.getUniformLocation(B,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;H=w.getContext("2d");H.fillStyle="#ffffff";H.fillRect(0,0,w.width,w.height);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(G,H,J,y){J=G.__webglSprites;if(y=J.length){r.useProgram(B);r.enableVertexAttribArray(p);
|
|
|
|
|
-r.enableVertexAttribArray(v);r.disable(r.CULL_FACE);r.enable(r.BLEND);r.bindBuffer(r.ARRAY_BUFFER,I);r.vertexAttribPointer(p,2,r.FLOAT,!1,16,0);r.vertexAttribPointer(v,2,r.FLOAT,!1,16,8);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,C);r.uniformMatrix4fv(k,!1,H.projectionMatrix.elements);r.activeTexture(r.TEXTURE0);r.uniform1i(f,0);var N=0,z=0,D=G.fog;D?(r.uniform3f(u,D.color.r,D.color.g,D.color.b),D instanceof THREE.Fog?(r.uniform1f(q,D.near),r.uniform1f(s,D.far),r.uniform1i(l,1),z=N=1):D instanceof THREE.FogExp2&&
|
|
|
|
|
-(r.uniform1f(n,D.density),r.uniform1i(l,2),z=N=2)):(r.uniform1i(l,0),z=N=0);for(var E,F=[],D=0;D<y;D++)E=J[D],!1!==E.visible&&(E._modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,E.matrixWorld),E.z=-E._modelViewMatrix.elements[14]);J.sort(w);for(D=0;D<y;D++)E=J[D],!1!==E.visible&&(H=E.material,r.uniform1f(t,H.alphaTest),r.uniformMatrix4fv(h,!1,E._modelViewMatrix.elements),F[0]=E.scale.x,F[1]=E.scale.y,E=G.fog&&H.fog?z:0,N!==E&&(r.uniform1i(l,E),N=E),null!==H.map?(r.uniform2f(a,H.map.offset.x,
|
|
|
|
|
-H.map.offset.y),r.uniform2f(b,H.map.repeat.x,H.map.repeat.y)):(r.uniform2f(a,0,0),r.uniform2f(b,1,1)),r.uniform1f(g,H.opacity),r.uniform3f(e,H.color.r,H.color.g,H.color.b),r.uniform1f(c,H.rotation),r.uniform2fv(d,F),x.setBlending(H.blending,H.blendEquation,H.blendSrc,H.blendDst),x.setDepthTest(H.depthTest),x.setDepthWrite(H.depthWrite),H.map&&H.map.image&&H.map.image.width?x.setTexture(H.map,0):x.setTexture(A,0),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0));r.enable(r.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
|
|
|
|
|
|
|
+r.getUniformLocation(B,"fogType");n=r.getUniformLocation(B,"fogDensity");q=r.getUniformLocation(B,"fogNear");s=r.getUniformLocation(B,"fogFar");u=r.getUniformLocation(B,"fogColor");t=r.getUniformLocation(B,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;H=w.getContext("2d");H.fillStyle="#ffffff";H.fillRect(0,0,w.width,w.height);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(F,H,J,y){J=F.__webglSprites;if(y=J.length){r.useProgram(B);r.enableVertexAttribArray(p);
|
|
|
|
|
+r.enableVertexAttribArray(v);r.disable(r.CULL_FACE);r.enable(r.BLEND);r.bindBuffer(r.ARRAY_BUFFER,I);r.vertexAttribPointer(p,2,r.FLOAT,!1,16,0);r.vertexAttribPointer(v,2,r.FLOAT,!1,16,8);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,z);r.uniformMatrix4fv(k,!1,H.projectionMatrix.elements);r.activeTexture(r.TEXTURE0);r.uniform1i(f,0);var N=0,E=0,C=F.fog;C?(r.uniform3f(u,C.color.r,C.color.g,C.color.b),C instanceof THREE.Fog?(r.uniform1f(q,C.near),r.uniform1f(s,C.far),r.uniform1i(l,1),E=N=1):C instanceof THREE.FogExp2&&
|
|
|
|
|
+(r.uniform1f(n,C.density),r.uniform1i(l,2),E=N=2)):(r.uniform1i(l,0),E=N=0);for(var D,G=[],C=0;C<y;C++)D=J[C],!1!==D.visible&&(D._modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,D.matrixWorld),D.z=-D._modelViewMatrix.elements[14]);J.sort(w);for(C=0;C<y;C++)D=J[C],!1!==D.visible&&(H=D.material,r.uniform1f(t,H.alphaTest),r.uniformMatrix4fv(h,!1,D._modelViewMatrix.elements),G[0]=D.scale.x,G[1]=D.scale.y,D=F.fog&&H.fog?E:0,N!==D&&(r.uniform1i(l,D),N=D),null!==H.map?(r.uniform2f(a,H.map.offset.x,
|
|
|
|
|
+H.map.offset.y),r.uniform2f(b,H.map.repeat.x,H.map.repeat.y)):(r.uniform2f(a,0,0),r.uniform2f(b,1,1)),r.uniform1f(g,H.opacity),r.uniform3f(e,H.color.r,H.color.g,H.color.b),r.uniform1f(c,H.rotation),r.uniform2fv(d,G),x.setBlending(H.blending,H.blendEquation,H.blendSrc,H.blendDst),x.setDepthTest(H.depthTest),x.setDepthWrite(H.depthWrite),H.map&&H.map.image&&H.map.image.width?x.setTexture(H.map,0):x.setTexture(A,0),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0));r.enable(r.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
|
|
|
vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(k,l){var n,q,s,u,t,p;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===k.autoUpdate&&k.updateMatrixWorld();l.matrixWorldInverse.getInverse(l.matrixWorld);h.multiplyMatrices(l.projectionMatrix,
|
|
vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(k,l){var n,q,s,u,t,p;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===k.autoUpdate&&k.updateMatrixWorld();l.matrixWorldInverse.getInverse(l.matrixWorld);h.multiplyMatrices(l.projectionMatrix,
|
|
|
l.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(this.renderTarget);b.clear();p=k.__webglObjects;n=0;for(q=p.length;n<q;n++)s=p[n],t=s.object,s.render=!1,!t.visible||(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)&&t.frustumCulled&&!g.intersectsObject(t)||(t._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,t.matrixWorld),s.render=!0);var v;n=0;for(q=p.length;n<q;n++)s=p[n],s.render&&(t=s.object,s=s.buffer,t instanceof THREE.ParticleSystem&&!t.customDepthMaterial||((v=
|
|
l.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(this.renderTarget);b.clear();p=k.__webglObjects;n=0;for(q=p.length;n<q;n++)s=p[n],t=s.object,s.render=!1,!t.visible||(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)&&t.frustumCulled&&!g.intersectsObject(t)||(t._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,t.matrixWorld),s.render=!0);var v;n=0;for(q=p.length;n<q;n++)s=p[n],s.render&&(t=s.object,s=s.buffer,t instanceof THREE.ParticleSystem&&!t.customDepthMaterial||((v=
|
|
|
t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material)&&b.setMaterialFaces(t.material),u=0<t.geometry.morphTargets.length&&v.morphTargets,v=t instanceof THREE.SkinnedMesh&&v.skinning,u=t.customDepthMaterial?t.customDepthMaterial:v?u?f:e:u?d:c,s instanceof THREE.BufferGeometry?b.renderBufferDirect(l,k.__lights,null,u,s,t):b.renderBuffer(l,k.__lights,null,u,s,t)));p=k.__webglObjectsImmediate;n=0;for(q=p.length;n<q;n++)s=p[n],t=s.object,t.visible&&(t._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,
|
|
t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material)&&b.setMaterialFaces(t.material),u=0<t.geometry.morphTargets.length&&v.morphTargets,v=t instanceof THREE.SkinnedMesh&&v.skinning,u=t.customDepthMaterial?t.customDepthMaterial:v?u?f:e:u?d:c,s instanceof THREE.BufferGeometry?b.renderBufferDirect(l,k.__lights,null,u,s,t):b.renderBuffer(l,k.__lights,null,u,s,t)));p=k.__webglObjectsImmediate;n=0;for(q=p.length;n<q;n++)s=p[n],t=s.object,t.visible&&(t._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,
|