|
@@ -67,7 +67,7 @@ this.elements,d=a.x,e=a.y,f=a.z,g=Math.cos(d),d=Math.sin(d),i=Math.cos(e),e=Math
|
|
|
d,c[10]=g*i):"ZYX"===b?(k=g*h,m=g*f,p=d*h,n=d*f,c[0]=i*h,c[4]=p*e-m,c[8]=k*e+n,c[1]=i*f,c[5]=n*e+k,c[9]=m*e-p,c[2]=-e,c[6]=d*i,c[10]=g*i):"YZX"===b?(k=g*i,m=g*e,p=d*i,n=d*e,c[0]=i*h,c[4]=n-k*f,c[8]=p*f+m,c[1]=f,c[5]=g*h,c[9]=-d*h,c[2]=-e*h,c[6]=m*f+p,c[10]=k-n*f):"XZY"===b&&(k=g*i,m=g*e,p=d*i,n=d*e,c[0]=i*h,c[4]=-f,c[8]=e*h,c[1]=k*f+n,c[5]=g*h,c[9]=m*f-p,c[2]=p*f-m,c[6]=d*h,c[10]=n*f+k);return this},setRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,i=d+d,h=e+
|
|
|
e,a=c*g,k=c*i,c=c*h,m=d*i,d=d*h,e=e*h,g=f*g,i=f*i,f=f*h;b[0]=1-(m+e);b[4]=k-f;b[8]=c+i;b[1]=k+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-i;b[6]=d+g;b[10]=1-(a+m);return this},lookAt:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.subVectors(a,b).normalize();0===g.length()&&(g.z=1);e.crossVectors(c,g).normalize();0===e.length()&&(g.x+=1E-4,e.crossVectors(c,g).normalize());f.crossVectors(g,e);d[0]=e.x;d[4]=f.x;d[8]=g.x;d[1]=e.y;d[5]=f.y;d[9]=g.y;d[2]=e.z;d[6]=
|
|
|
f.z;d[10]=g.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],i=c[8],h=c[12],k=c[1],m=c[5],p=c[9],n=c[13],s=c[2],q=c[6],l=c[10],r=c[14],t=c[3],x=c[7],z=c[11],c=c[15],w=d[0],I=d[4],H=d[8],D=d[12],y=d[1],E=d[5],F=d[9],G=d[13],
|
|
|
-W=d[2],A=d[6],X=d[10],B=d[14],K=d[3],L=d[7],P=d[11],d=d[15];e[0]=f*w+g*y+i*W+h*K;e[4]=f*I+g*E+i*A+h*L;e[8]=f*H+g*F+i*X+h*P;e[12]=f*D+g*G+i*B+h*d;e[1]=k*w+m*y+p*W+n*K;e[5]=k*I+m*E+p*A+n*L;e[9]=k*H+m*F+p*X+n*P;e[13]=k*D+m*G+p*B+n*d;e[2]=s*w+q*y+l*W+r*K;e[6]=s*I+q*E+l*A+r*L;e[10]=s*H+q*F+l*X+r*P;e[14]=s*D+q*G+l*B+r*d;e[3]=t*w+x*y+z*W+c*K;e[7]=t*I+x*E+z*A+c*L;e[11]=t*H+x*F+z*X+c*P;e[15]=t*D+x*G+z*B+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];
|
|
|
+W=d[2],A=d[6],X=d[10],B=d[14],K=d[3],L=d[7],U=d[11],d=d[15];e[0]=f*w+g*y+i*W+h*K;e[4]=f*I+g*E+i*A+h*L;e[8]=f*H+g*F+i*X+h*U;e[12]=f*D+g*G+i*B+h*d;e[1]=k*w+m*y+p*W+n*K;e[5]=k*I+m*E+p*A+n*L;e[9]=k*H+m*F+p*X+n*U;e[13]=k*D+m*G+p*B+n*d;e[2]=s*w+q*y+l*W+r*K;e[6]=s*I+q*E+l*A+r*L;e[10]=s*H+q*F+l*X+r*U;e[14]=s*D+q*G+l*B+r*d;e[3]=t*w+x*y+z*W+c*K;e[7]=t*I+x*E+z*A+c*L;e[11]=t*H+x*F+z*X+c*U;e[15]=t*D+x*G+z*B+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 is now vector.applyMatrix4( matrix ) instead.");
|
|
|
return a.applyMatrix4(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use is now vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){for(var b=THREE.Matrix4.__v1,c=0,d=a.length;c<d;c+=3)b.x=a[c],b.y=a[c+1],b.z=a[c+2],b.applyMatrix4(this),a[c]=b.x,a[c+1]=b.y,a[c+2]=b.z;return a},rotateAxis:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z;a.x=c*b[0]+d*b[4]+e*b[8];a.y=c*b[1]+d*b[5]+e*b[9];
|
|
|
a.z=c*b[2]+d*b[6]+e*b[10];a.normalize();return a},crossVector:function(a){var b=this.elements,c=new THREE.Vector4;c.x=b[0]*a.x+b[4]*a.y+b[8]*a.z+b[12]*a.w;c.y=b[1]*a.x+b[5]*a.y+b[9]*a.z+b[13]*a.w;c.z=b[2]*a.x+b[6]*a.y+b[10]*a.z+b[14]*a.w;c.w=a.w?b[3]*a.x+b[7]*a.y+b[11]*a.z+b[15]*a.w:1;return c},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],i=a[9],h=a[13],k=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*i*m-d*h*m-e*g*p+c*h*p+d*g*n-c*i*n)+a[7]*(+b*i*n-b*h*p+e*f*
|
|
@@ -130,19 +130,19 @@ traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.chi
|
|
|
!1===this.useQuaternion?this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder):this.matrix.setRotationFromQuaternion(this.quaternion);(1!==this.scale.x||1!==this.scale.y||1!==this.scale.z)&&this.matrix.scale(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){void 0===a&&(a=new THREE.Object3D);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.rotation instanceof THREE.Vector3&&a.rotation.copy(this.rotation);a.eulerOrder=this.eulerOrder;a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixRotationWorld.copy(this.matrixRotationWorld);
|
|
|
a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.quaternion.copy(this.quaternion);a.useQuaternion=this.useQuaternion;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;for(var b=0;b<this.children.length;b++)a.add(this.children[b].clone());return a}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3D.defaultEulerOrder="XYZ";THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(f===i){var a=new THREE.RenderableObject;g.push(a);i++;f++;return a}return g[f++]}function b(){if(k===p){var a=new THREE.RenderableVertex;m.push(a);p++;k++;return a}return m[k++]}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,i=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=i)return!0;if(0>e&&0>f||0>g&&0>i)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-i)):0>i&&(d=Math.min(d,g/(g-i)));if(d<
|
|
|
-c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var e,f,g=[],i=0,h,k,m=[],p=0,n,s,q=[],l=0,r,t=[],x=0,z,w,I=[],H=0,D,y,E=[],F=0,G={objects:[],sprites:[],lights:[],elements:[]},W=new THREE.Vector3,A=new THREE.Vector4,X=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),B=new THREE.Box3,K=new THREE.Matrix4,L=new THREE.Matrix4,P,Z=new THREE.Matrix4,na=new THREE.Matrix3,pa=new THREE.Matrix3,J=new THREE.Vector3,ha=new THREE.Frustum,ra=new THREE.Vector4,fa=new THREE.Vector4;this.projectVector=
|
|
|
-function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);L.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyMatrix4(L)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);L.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyMatrix4(L)};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)};
|
|
|
-this.projectScene=function(g,i,p,Fa){var la=!1,qa,da,xa,ka,ya,Pa,ea,ua,sa,lb,Ja,tb,eb;y=w=r=s=0;G.elements.length=0;g.updateMatrixWorld();void 0===i.parent&&i.updateMatrixWorld();K.copy(i.matrixWorldInverse.getInverse(i.matrixWorld));L.multiplyMatrices(i.projectionMatrix,K);pa.getInverse(K);pa.transpose();ha.setFromMatrix(L);f=0;G.objects.length=0;G.sprites.length=0;G.lights.length=0;var Db=function(b){for(var c=0,d=b.children.length;c<d;c++){var f=b.children[c];if(!1!==f.visible){if(f instanceof
|
|
|
-THREE.Light)G.lights.push(f);else if(f instanceof THREE.Mesh||f instanceof THREE.Line){if(!1===f.frustumCulled||!0===ha.intersectsObject(f))e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(L),e.z=W.z),G.objects.push(e)}else f instanceof THREE.Sprite||f instanceof THREE.Particle?(e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(L),e.z=W.z),G.sprites.push(e)):(e=a(),e.object=f,null!==
|
|
|
-f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(L),e.z=W.z),G.objects.push(e));Db(f)}}};Db(g);!0===p&&G.objects.sort(c);g=0;for(p=G.objects.length;g<p;g++)if(ua=G.objects[g].object,P=ua.matrixWorld,k=0,ua instanceof THREE.Mesh){sa=ua.geometry;xa=sa.vertices;lb=sa.faces;sa=sa.faceVertexUvs;na.getInverse(P);na.transpose();tb=ua.material instanceof THREE.MeshFaceMaterial;eb=!0===tb?ua.material:null;qa=0;for(da=xa.length;qa<da;qa++)h=b(),h.positionWorld.copy(xa[qa]).applyMatrix4(P),
|
|
|
-h.positionScreen.copy(h.positionWorld).applyMatrix4(L),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.positionScreen.z/=h.positionScreen.w,h.visible=!(-1>h.positionScreen.x||1<h.positionScreen.x||-1>h.positionScreen.y||1<h.positionScreen.y||-1>h.positionScreen.z||1<h.positionScreen.z);xa=0;for(qa=lb.length;xa<qa;xa++){da=lb[xa];var yb=!0===tb?eb.materials[da.materialIndex]:ua.material;if(void 0!==yb){Pa=yb.side;if(da instanceof THREE.Face3)if(ka=m[da.a],ya=m[da.b],
|
|
|
-ea=m[da.c],!0===ka.visible||!0===ya.visible||!0===ea.visible||X.isIntersectionBox(B.setFromPoints([ka.positionScreen,ya.positionScreen,ea.positionScreen])))if(la=0>(ea.positionScreen.x-ka.positionScreen.x)*(ya.positionScreen.y-ka.positionScreen.y)-(ea.positionScreen.y-ka.positionScreen.y)*(ya.positionScreen.x-ka.positionScreen.x),Pa===THREE.DoubleSide||la===(Pa===THREE.FrontSide))s===l?(Ja=new THREE.RenderableFace3,q.push(Ja),l++,s++,n=Ja):n=q[s++],n.v1.copy(ka),n.v2.copy(ya),n.v3.copy(ea);else continue;
|
|
|
-else continue;else if(da instanceof THREE.Face4)if(ka=m[da.a],ya=m[da.b],ea=m[da.c],Ja=m[da.d],!0===ka.visible||!0===ya.visible||!0===ea.visible||!0===Ja.visible||X.isIntersectionBox(B.setFromPoints([ka.positionScreen,ya.positionScreen,ea.positionScreen,Ja.positionScreen])))if(la=0>(Ja.positionScreen.x-ka.positionScreen.x)*(ya.positionScreen.y-ka.positionScreen.y)-(Ja.positionScreen.y-ka.positionScreen.y)*(ya.positionScreen.x-ka.positionScreen.x)||0>(ya.positionScreen.x-ea.positionScreen.x)*(Ja.positionScreen.y-
|
|
|
-ea.positionScreen.y)-(ya.positionScreen.y-ea.positionScreen.y)*(Ja.positionScreen.x-ea.positionScreen.x),Pa===THREE.DoubleSide||la===(Pa===THREE.FrontSide)){if(r===x){var Lb=new THREE.RenderableFace4;t.push(Lb);x++;r++;n=Lb}else n=t[r++];n.v1.copy(ka);n.v2.copy(ya);n.v3.copy(ea);n.v4.copy(Ja)}else continue;else continue;n.normalModel.copy(da.normal);!1===la&&(Pa===THREE.BackSide||Pa===THREE.DoubleSide)&&n.normalModel.negate();n.normalModel.applyMatrix3(na).normalize();n.normalModelView.copy(n.normalModel).applyMatrix3(pa);
|
|
|
-n.centroidModel.copy(da.centroid).applyMatrix4(P);ea=da.vertexNormals;ka=0;for(ya=ea.length;ka<ya;ka++)Ja=n.vertexNormalsModel[ka],Ja.copy(ea[ka]),!1===la&&(Pa===THREE.BackSide||Pa===THREE.DoubleSide)&&Ja.negate(),Ja.applyMatrix3(na).normalize(),n.vertexNormalsModelView[ka].copy(Ja).applyMatrix3(pa);n.vertexNormalsLength=ea.length;ka=0;for(ya=sa.length;ka<ya;ka++)if(Ja=sa[ka][xa],void 0!==Ja){Pa=0;for(ea=Ja.length;Pa<ea;Pa++)n.uvs[ka][Pa]=Ja[Pa]}n.color=da.color;n.material=yb;J.copy(n.centroidModel).applyMatrix4(L);
|
|
|
-n.z=J.z;G.elements.push(n)}}}else if(ua instanceof THREE.Line){Z.multiplyMatrices(L,P);xa=ua.geometry.vertices;ka=b();ka.positionScreen.copy(xa[0]).applyMatrix4(Z);lb=ua.type===THREE.LinePieces?2:1;qa=1;for(da=xa.length;qa<da;qa++)ka=b(),ka.positionScreen.copy(xa[qa]).applyMatrix4(Z),0<(qa+1)%lb||(ya=m[k-2],ra.copy(ka.positionScreen),fa.copy(ya.positionScreen),!0===d(ra,fa)&&(ra.multiplyScalar(1/ra.w),fa.multiplyScalar(1/fa.w),w===H?(sa=new THREE.RenderableLine,I.push(sa),H++,w++,z=sa):z=I[w++],z.v1.positionScreen.copy(ra),
|
|
|
-z.v2.positionScreen.copy(fa),z.z=Math.max(ra.z,fa.z),z.material=ua.material,G.elements.push(z)))}g=0;for(p=G.sprites.length;g<p;g++)ua=G.sprites[g].object,P=ua.matrixWorld,ua instanceof THREE.Particle&&(A.set(P.elements[12],P.elements[13],P.elements[14],1),A.applyMatrix4(L),A.z/=A.w,0<A.z&&1>A.z&&(y===F?(la=new THREE.RenderableParticle,E.push(la),F++,y++,D=la):D=E[y++],D.object=ua,D.x=A.x/A.w,D.y=A.y/A.w,D.z=A.z,D.rotation=ua.rotation.z,D.scale.x=ua.scale.x*Math.abs(D.x-(A.x+i.projectionMatrix.elements[0])/
|
|
|
-(A.w+i.projectionMatrix.elements[12])),D.scale.y=ua.scale.y*Math.abs(D.y-(A.y+i.projectionMatrix.elements[5])/(A.w+i.projectionMatrix.elements[13])),D.material=ua.material,G.elements.push(D)));!0===Fa&&G.elements.sort(c);return G}};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};
|
|
|
+c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var e,f,g=[],i=0,h,k,m=[],p=0,n,s,q=[],l=0,r,t=[],x=0,z,w,I=[],H=0,D,y,E=[],F=0,G={objects:[],sprites:[],lights:[],elements:[]},W=new THREE.Vector3,A=new THREE.Vector4,X=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),B=new THREE.Box3,K=Array(3),L=Array(4),U=new THREE.Matrix4,aa=new THREE.Matrix4,ba,xa=new THREE.Matrix4,J=new THREE.Matrix3,ha=new THREE.Matrix3,ua=new THREE.Vector3,Oa=new THREE.Frustum,M=new THREE.Vector4,fa=new THREE.Vector4;
|
|
|
+this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);aa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyMatrix4(aa)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);aa.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyMatrix4(aa)};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)};this.projectScene=function(g,i,p,Ja){var ma=!1,wa,Ta,Ra,ia,ra,ga,Z,pa,gb,hb,Ea,yb,Cb;y=w=r=s=0;G.elements.length=0;g.updateMatrixWorld();void 0===i.parent&&i.updateMatrixWorld();U.copy(i.matrixWorldInverse.getInverse(i.matrixWorld));aa.multiplyMatrices(i.projectionMatrix,U);ha.getInverse(U);ha.transpose();Oa.setFromMatrix(aa);f=0;G.objects.length=0;G.sprites.length=0;G.lights.length=0;var Lb=function(b){for(var c=0,d=b.children.length;c<d;c++){var f=b.children[c];if(!1!==f.visible){if(f instanceof
|
|
|
+THREE.Light)G.lights.push(f);else if(f instanceof THREE.Mesh||f instanceof THREE.Line){if(!1===f.frustumCulled||!0===Oa.intersectsObject(f))e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(aa),e.z=W.z),G.objects.push(e)}else f instanceof THREE.Sprite||f instanceof THREE.Particle?(e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(aa),e.z=W.z),G.sprites.push(e)):(e=a(),e.object=f,null!==
|
|
|
+f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(aa),e.z=W.z),G.objects.push(e));Lb(f)}}};Lb(g);!0===p&&G.objects.sort(c);g=0;for(p=G.objects.length;g<p;g++)if(pa=G.objects[g].object,ba=pa.matrixWorld,k=0,pa instanceof THREE.Mesh){gb=pa.geometry;Ra=gb.vertices;hb=gb.faces;gb=gb.faceVertexUvs;J.getInverse(ba);J.transpose();yb=pa.material instanceof THREE.MeshFaceMaterial;Cb=!0===yb?pa.material:null;wa=0;for(Ta=Ra.length;wa<Ta;wa++)h=b(),h.positionWorld.copy(Ra[wa]).applyMatrix4(ba),
|
|
|
+h.positionScreen.copy(h.positionWorld).applyMatrix4(aa),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.positionScreen.z/=h.positionScreen.w,h.visible=!(-1>h.positionScreen.x||1<h.positionScreen.x||-1>h.positionScreen.y||1<h.positionScreen.y||-1>h.positionScreen.z||1<h.positionScreen.z);Ra=0;for(wa=hb.length;Ra<wa;Ra++){Ta=hb[Ra];var Ua=!0===yb?Cb.materials[Ta.materialIndex]:pa.material;if(void 0!==Ua){ga=Ua.side;if(Ta instanceof THREE.Face3)if(ia=m[Ta.a],ra=m[Ta.b],
|
|
|
+Z=m[Ta.c],K[0]=ia.positionScreen,K[1]=ra.positionScreen,K[2]=Z.positionScreen,!0===ia.visible||!0===ra.visible||!0===Z.visible||X.isIntersectionBox(B.setFromPoints(K)))if(ma=0>(Z.positionScreen.x-ia.positionScreen.x)*(ra.positionScreen.y-ia.positionScreen.y)-(Z.positionScreen.y-ia.positionScreen.y)*(ra.positionScreen.x-ia.positionScreen.x),ga===THREE.DoubleSide||ma===(ga===THREE.FrontSide))s===l?(Ea=new THREE.RenderableFace3,q.push(Ea),l++,s++,n=Ea):n=q[s++],n.v1.copy(ia),n.v2.copy(ra),n.v3.copy(Z);
|
|
|
+else continue;else continue;else if(Ta instanceof THREE.Face4)if(ia=m[Ta.a],ra=m[Ta.b],Z=m[Ta.c],Ea=m[Ta.d],L[0]=ia.positionScreen,L[1]=ra.positionScreen,L[2]=Z.positionScreen,L[3]=Ea.positionScreen,!0===ia.visible||!0===ra.visible||!0===Z.visible||!0===Ea.visible||X.isIntersectionBox(B.setFromPoints(L)))if(ma=0>(Ea.positionScreen.x-ia.positionScreen.x)*(ra.positionScreen.y-ia.positionScreen.y)-(Ea.positionScreen.y-ia.positionScreen.y)*(ra.positionScreen.x-ia.positionScreen.x)||0>(ra.positionScreen.x-
|
|
|
+Z.positionScreen.x)*(Ea.positionScreen.y-Z.positionScreen.y)-(ra.positionScreen.y-Z.positionScreen.y)*(Ea.positionScreen.x-Z.positionScreen.x),ga===THREE.DoubleSide||ma===(ga===THREE.FrontSide)){if(r===x){var na=new THREE.RenderableFace4;t.push(na);x++;r++;n=na}else n=t[r++];n.v1.copy(ia);n.v2.copy(ra);n.v3.copy(Z);n.v4.copy(Ea)}else continue;else continue;n.normalModel.copy(Ta.normal);!1===ma&&(ga===THREE.BackSide||ga===THREE.DoubleSide)&&n.normalModel.negate();n.normalModel.applyMatrix3(J).normalize();
|
|
|
+n.normalModelView.copy(n.normalModel).applyMatrix3(ha);n.centroidModel.copy(Ta.centroid).applyMatrix4(ba);Z=Ta.vertexNormals;ia=0;for(ra=Z.length;ia<ra;ia++)Ea=n.vertexNormalsModel[ia],Ea.copy(Z[ia]),!1===ma&&(ga===THREE.BackSide||ga===THREE.DoubleSide)&&Ea.negate(),Ea.applyMatrix3(J).normalize(),n.vertexNormalsModelView[ia].copy(Ea).applyMatrix3(ha);n.vertexNormalsLength=Z.length;ia=0;for(ra=gb.length;ia<ra;ia++)if(Ea=gb[ia][Ra],void 0!==Ea){ga=0;for(Z=Ea.length;ga<Z;ga++)n.uvs[ia][ga]=Ea[ga]}n.color=
|
|
|
+Ta.color;n.material=Ua;ua.copy(n.centroidModel).applyMatrix4(aa);n.z=ua.z;G.elements.push(n)}}}else if(pa instanceof THREE.Line){xa.multiplyMatrices(aa,ba);Ra=pa.geometry.vertices;ia=b();ia.positionScreen.copy(Ra[0]).applyMatrix4(xa);hb=pa.type===THREE.LinePieces?2:1;wa=1;for(Ta=Ra.length;wa<Ta;wa++)ia=b(),ia.positionScreen.copy(Ra[wa]).applyMatrix4(xa),0<(wa+1)%hb||(ra=m[k-2],M.copy(ia.positionScreen),fa.copy(ra.positionScreen),!0===d(M,fa)&&(M.multiplyScalar(1/M.w),fa.multiplyScalar(1/fa.w),w===
|
|
|
+H?(gb=new THREE.RenderableLine,I.push(gb),H++,w++,z=gb):z=I[w++],z.v1.positionScreen.copy(M),z.v2.positionScreen.copy(fa),z.z=Math.max(M.z,fa.z),z.material=pa.material,G.elements.push(z)))}g=0;for(p=G.sprites.length;g<p;g++)pa=G.sprites[g].object,ba=pa.matrixWorld,pa instanceof THREE.Particle&&(A.set(ba.elements[12],ba.elements[13],ba.elements[14],1),A.applyMatrix4(aa),A.z/=A.w,0<A.z&&1>A.z&&(y===F?(ma=new THREE.RenderableParticle,E.push(ma),F++,y++,D=ma):D=E[y++],D.object=pa,D.x=A.x/A.w,D.y=A.y/
|
|
|
+A.w,D.z=A.z,D.rotation=pa.rotation.z,D.scale.x=pa.scale.x*Math.abs(D.x-(A.x+i.projectionMatrix.elements[0])/(A.w+i.projectionMatrix.elements[12])),D.scale.y=pa.scale.y*Math.abs(D.y-(A.y+i.projectionMatrix.elements[5])/(A.w+i.projectionMatrix.elements[13])),D.material=pa.material,G.elements.push(D)));!0===Ja&&G.elements.sort(c);return G}};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();
|
|
|
return a}};THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=void 0!==g?g:0;this.centroid=new THREE.Vector3};
|
|
|
THREE.Face4.prototype={constructor:THREE.Face4,clone:function(){var a=new THREE.Face4(this.a,this.b,this.c,this.d);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();
|
|
@@ -169,10 +169,10 @@ var a=this.attributes.position.array;if(a){var b=this.boundingBox,c,d,e;3<=a.len
|
|
|
new THREE.Sphere);var a=this.attributes.position.array;if(a){for(var b,c=0,d,e,f=0,g=a.length;f<g;f+=3)b=a[f],d=a[f+1],e=a[f+2],b=b*b+d*d+e*e,b>c&&(c=b);this.boundingSphere.radius=Math.sqrt(c)}},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a),numItems:a};else{a=0;for(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,i,h,k,m,p,n=new THREE.Vector3,s=new THREE.Vector3,q=new THREE.Vector3,l=new THREE.Vector3,r=new THREE.Vector3;if(this.attributes.index){var t=this.attributes.index.array,x=this.offsets;c=0;for(d=x.length;c<d;++c){b=x[c].start;g=x[c].count;var z=x[c].index;a=b;for(b+=g;a<b;a+=3)g=z+t[a],i=z+t[a+1],h=z+t[a+2],k=e[3*g],m=e[3*g+1],p=e[3*g+2],n.set(k,m,p),k=e[3*i],m=e[3*i+1],p=e[3*i+2],s.set(k,m,p),k=e[3*h],m=e[3*h+1],p=e[3*h+2],q.set(k,
|
|
|
m,p),l.subVectors(q,s),r.subVectors(n,s),l.cross(r),f[3*g]+=l.x,f[3*g+1]+=l.y,f[3*g+2]+=l.z,f[3*i]+=l.x,f[3*i+1]+=l.y,f[3*i+2]+=l.z,f[3*h]+=l.x,f[3*h+1]+=l.y,f[3*h+2]+=l.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],m=e[a+1],p=e[a+2],n.set(k,m,p),k=e[a+3],m=e[a+4],p=e[a+5],s.set(k,m,p),k=e[a+6],m=e[a+7],p=e[a+8],q.set(k,m,p),l.subVectors(q,s),r.subVectors(n,s),l.cross(r),f[a]=l.x,f[a+1]=l.y,f[a+2]=l.z,f[a+3]=l.x,f[a+4]=l.y,f[a+5]=l.z,f[a+6]=l.x,f[a+7]=l.y,f[a+8]=l.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){na.x=d[3*a];na.y=d[3*a+1];na.z=d[3*a+2];pa.copy(na);ha=h[a];P.copy(ha);P.sub(na.multiplyScalar(na.dot(ha))).normalize();Z.crossVectors(pa,ha);ra=Z.dot(k[a]);J=0>ra?-1:1;i[4*a]=P.x;i[4*a+1]=P.y;i[4*a+2]=P.z;i[4*a+3]=J}if(void 0===this.attributes.index||void 0===this.attributes.position||
|
|
|
+!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){ba.x=d[3*a];ba.y=d[3*a+1];ba.z=d[3*a+2];xa.copy(ba);ha=h[a];U.copy(ha);U.sub(ba.multiplyScalar(ba.dot(ha))).normalize();aa.crossVectors(xa,ha);ua=aa.dot(k[a]);J=0>ua?-1:1;i[4*a]=U.x;i[4*a+1]=U.y;i[4*a+2]=U.z;i[4*a+3]=J}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 b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;if(void 0===this.attributes.tangent){var g=4*f;this.attributes.tangent={itemSize:4,array:new Float32Array(g),numItems:g}}for(var i=this.attributes.tangent.array,h=[],k=[],g=0;g<f;g++)h[g]=
|
|
|
new THREE.Vector3,k[g]=new THREE.Vector3;var m,p,n,s,q,l,r,t,x,z,w,I,H,D,y,f=new THREE.Vector3,g=new THREE.Vector3,E,F,G,W,A,X,B,K=this.offsets;G=0;for(W=K.length;G<W;++G){F=K[G].start;A=K[G].count;var L=K[G].index;E=F;for(F+=A;E<F;E+=3)A=L+b[E],X=L+b[E+1],B=L+b[E+2],m=c[3*A],p=c[3*A+1],n=c[3*A+2],s=c[3*X],q=c[3*X+1],l=c[3*X+2],r=c[3*B],t=c[3*B+1],x=c[3*B+2],z=e[2*A],w=e[2*A+1],I=e[2*X],H=e[2*X+1],D=e[2*B],y=e[2*B+1],s-=m,m=r-m,q-=p,p=t-p,l-=n,n=x-n,I-=z,z=D-z,H-=w,w=y-w,y=1/(I*w-z*H),f.set((w*s-
|
|
|
-H*m)*y,(w*q-H*p)*y,(w*l-H*n)*y),g.set((I*m-z*s)*y,(I*p-z*q)*y,(I*n-z*l)*y),h[A].add(f),h[X].add(f),h[B].add(f),k[A].add(g),k[X].add(g),k[B].add(g)}var P=new THREE.Vector3,Z=new THREE.Vector3,na=new THREE.Vector3,pa=new THREE.Vector3,J,ha,ra;G=0;for(W=K.length;G<W;++G){F=K[G].start;A=K[G].count;L=K[G].index;E=F;for(F+=A;E<F;E+=3)A=L+b[E],X=L+b[E+1],B=L+b[E+2],a(A),a(X),a(B)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);!0===this.rotationAutoUpdate&&(!1===this.useQuaternion?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):this.quaternion.copy(this.matrix.decompose()[1]))};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.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
|
|
|
+H*m)*y,(w*q-H*p)*y,(w*l-H*n)*y),g.set((I*m-z*s)*y,(I*p-z*q)*y,(I*n-z*l)*y),h[A].add(f),h[X].add(f),h[B].add(f),k[A].add(g),k[X].add(g),k[B].add(g)}var U=new THREE.Vector3,aa=new THREE.Vector3,ba=new THREE.Vector3,xa=new THREE.Vector3,J,ha,ua;G=0;for(W=K.length;G<W;++G){F=K[G].start;A=K[G].count;L=K[G].index;E=F;for(F+=A;E<F;E+=3)A=L+b[E],X=L+b[E+1],B=L+b[E+2],a(A),a(X),a(B)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);!0===this.rotationAutoUpdate&&(!1===this.useQuaternion?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):this.quaternion.copy(this.matrix.decompose()[1]))};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.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
|
|
|
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
|
|
|
THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(0.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=0.5;this.quadraticAttenuation=0.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=
|
|
|
new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a);this.groundColor=new THREE.Color(b);this.position=new THREE.Vector3(0,100,0);this.intensity=void 0!==c?c:1};THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype);THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0};THREE.PointLight.prototype=Object.create(THREE.Light.prototype);THREE.SpotLight=function(a,b,c,d,e){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/2;this.exponent=void 0!==e?e:10;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowMatrix=this.shadowCamera=
|
|
@@ -259,35 +259,35 @@ THREE.LOD.prototype.update=function(a){if(1<this.LODs.length){a.matrixWorldInver
|
|
|
THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.matrixAutoUpdate=!1;this.__objects=[];this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&-1===this.__objects.indexOf(a)){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
|
|
|
THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.__objects.indexOf(a),-1!==b&&(this.__objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a){x!==a&&(x=l.globalAlpha=a)}function c(a){z!==a&&(a===THREE.NormalBlending?l.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?l.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(l.globalCompositeOperation="darker"),z=a)}function d(a){w!==a&&(w=l.strokeStyle=a)}function e(a){I!==a&&(I=l.fillStyle=a)}console.log("THREE.CanvasRenderer",THREE.REVISION);var a=a||{},f=this,g,i,h,k=new THREE.Projector,m=void 0!==a.canvas?a.canvas:
|
|
|
-document.createElement("canvas"),p,n,s,q,l=m.getContext("2d"),r=new THREE.Color(0),t=0,x=1,z=0,w=null,I=null,H=null,D=null,y=null,E,F,G,W,A=new THREE.RenderableVertex,X=new THREE.RenderableVertex,B,K,L,P,Z,na,pa,J,ha,ra,fa,M,ja=new THREE.Color,Ea=new THREE.Color,Fa=new THREE.Color,la=new THREE.Color,qa=new THREE.Color,da=new THREE.Color,xa=new THREE.Color,ka=new THREE.Color,ya={},Pa={},ea,ua,sa,lb,Ja,tb,eb,Db,yb,Lb,qb=new THREE.Box2,Sa=new THREE.Box2,Ka=new THREE.Box2,Cb=!1,Qa=new THREE.Color,kc=
|
|
|
-new THREE.Color,Mb=new THREE.Color,pb=new THREE.Vector3,zb,Ob,rc,mb,Ga,rb,fb=16;zb=document.createElement("canvas");zb.width=zb.height=2;Ob=zb.getContext("2d");Ob.fillStyle="rgba(0,0,0,1)";Ob.fillRect(0,0,2,2);rc=Ob.getImageData(0,0,2,2);mb=rc.data;Ga=document.createElement("canvas");Ga.width=Ga.height=fb;rb=Ga.getContext("2d");rb.translate(-fb/2,-fb/2);rb.scale(fb,fb);fb--;this.domElement=m;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.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){p=a*this.devicePixelRatio;n=b*this.devicePixelRatio;s=Math.floor(p/2);q=Math.floor(n/2);m.width=p;m.height=n;m.style.width=a+"px";m.style.height=b+"px";qb.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q));Sa.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q));x=1;z=0;y=D=H=I=w=null};this.setClearColor=
|
|
|
-function(a,b){r.copy(a);t=void 0!==b?b:1;Sa.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q))};this.setClearColorHex=function(a,b){r.setHex(a);t=void 0!==b?b:1;Sa.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q))};this.getMaxAnisotropy=function(){return 0};this.clear=function(){l.setTransform(1,0,0,-1,s,q);!1===Sa.empty()&&(Sa.intersect(qb),Sa.expandByScalar(2),1>t&&l.clearRect(Sa.min.x|0,Sa.min.y|0,Sa.max.x-Sa.min.x|0,Sa.max.y-Sa.min.y|0),0<t&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(255*
|
|
|
-r.r)+","+Math.floor(255*r.g)+","+Math.floor(255*r.b)+","+t+")"),l.fillRect(Sa.min.x|0,Sa.min.y|0,Sa.max.x-Sa.min.x|0,Sa.max.y-Sa.min.y|0)),Sa.makeEmpty())};this.render=function(a,m){function n(a,b,c){for(var d=0,e=h.length;d<e;d++){var f=h[d];ka.copy(f.color);if(f instanceof THREE.DirectionalLight){var g=f.matrixWorld.getPosition().normalize(),j=b.dot(g);0>=j||(j*=f.intensity,c.add(ka.multiplyScalar(j)))}else f instanceof THREE.PointLight&&(g=f.matrixWorld.getPosition(),j=b.dot(pb.subVectors(g,a).normalize()),
|
|
|
-0>=j||(j*=0==f.distance?1:1-Math.min(a.distanceTo(g)/f.distance,1),0!=j&&(j*=f.intensity,c.add(ka.multiplyScalar(j)))))}}function p(a,d,e,g,j,i,h,Y){f.info.render.vertices+=3;f.info.render.faces++;b(Y.opacity);c(Y.blending);B=a.positionScreen.x;K=a.positionScreen.y;L=d.positionScreen.x;P=d.positionScreen.y;Z=e.positionScreen.x;na=e.positionScreen.y;r(B,K,L,P,Z,na);(Y instanceof THREE.MeshLambertMaterial||Y instanceof THREE.MeshPhongMaterial)&&null===Y.map&&null===Y.map?(da.copy(Y.color),xa.copy(Y.emissive),
|
|
|
-Y.vertexColors===THREE.FaceColors&&da.multiply(h.color),!0===Cb?!1===Y.wireframe&&Y.shading==THREE.SmoothShading&&3==h.vertexNormalsLength?(Ea.copy(Qa),Fa.copy(Qa),la.copy(Qa),n(h.v1.positionWorld,h.vertexNormalsModel[0],Ea),n(h.v2.positionWorld,h.vertexNormalsModel[1],Fa),n(h.v3.positionWorld,h.vertexNormalsModel[2],la),Ea.multiply(da).add(xa),Fa.multiply(da).add(xa),la.multiply(da).add(xa),qa.addColors(Fa,la).multiplyScalar(0.5),sa=gb(Ea,Fa,la,qa),I(B,K,L,P,Z,na,0,0,1,0,0,1,sa)):(ja.copy(Qa),n(h.centroidModel,
|
|
|
-h.normalModel,ja),ja.multiply(da).add(xa),!0===Y.wireframe?x(ja,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(ja)):!0===Y.wireframe?x(Y.color,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(Y.color)):Y instanceof THREE.MeshBasicMaterial||Y instanceof THREE.MeshLambertMaterial||Y instanceof THREE.MeshPhongMaterial?null!==Y.map?Y.map.mapping instanceof THREE.UVMapping&&(lb=h.uvs[0],z(B,K,L,P,Z,na,lb[g].x,lb[g].y,lb[j].x,lb[j].y,lb[i].x,lb[i].y,Y.map)):null!==Y.envMap?
|
|
|
-Y.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(pb.copy(h.vertexNormalsModelView[g]),Ja=0.5*pb.x+0.5,tb=0.5*pb.y+0.5,pb.copy(h.vertexNormalsModelView[j]),eb=0.5*pb.x+0.5,Db=0.5*pb.y+0.5,pb.copy(h.vertexNormalsModelView[i]),yb=0.5*pb.x+0.5,Lb=0.5*pb.y+0.5,z(B,K,L,P,Z,na,Ja,tb,eb,Db,yb,Lb,Y.envMap)):(ja.copy(Y.color),Y.vertexColors===THREE.FaceColors&&ja.multiply(h.color),!0===Y.wireframe?x(ja,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(ja)):Y instanceof THREE.MeshDepthMaterial?
|
|
|
-(ea=m.near,ua=m.far,j=1-ab(a.positionScreen.z*a.positionScreen.w,ea,ua),Ea.setRGB(j,j,j),j=1-ab(d.positionScreen.z*d.positionScreen.w,ea,ua),Fa.setRGB(j,j,j),j=1-ab(e.positionScreen.z*e.positionScreen.w,ea,ua),la.setRGB(j,j,j),qa.addColors(Fa,la).multiplyScalar(0.5),sa=gb(Ea,Fa,la,qa),I(B,K,L,P,Z,na,0,0,1,0,0,1,sa)):Y instanceof THREE.MeshNormalMaterial&&(Y.shading==THREE.FlatShading?(d=h.normalModelView,ja.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),!0===Y.wireframe?x(ja,Y.wireframeLinewidth,
|
|
|
-Y.wireframeLinecap,Y.wireframeLinejoin):w(ja)):Y.shading==THREE.SmoothShading&&(d=h.vertexNormalsModelView[g],Ea.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[j],Fa.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[i],la.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),qa.addColors(Fa,la).multiplyScalar(0.5),sa=gb(Ea,Fa,la,qa),I(B,K,L,P,Z,na,0,0,1,0,0,1,sa)))}function r(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);
|
|
|
-l.lineTo(e,f);l.closePath()}function t(a,b,c,d,e,f,g,j){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(g,j);l.closePath()}function x(a,b,c,e){H!==b&&(H=l.lineWidth=b);D!==c&&(D=l.lineCap=c);y!==e&&(y=l.lineJoin=e);d(a.getStyle());l.stroke();Ka.expandByScalar(2*b)}function w(a){e(a.getStyle());l.fill()}function z(a,b,c,d,f,g,j,i,h,Y,k,m,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,q=n.wrapT==
|
|
|
-THREE.RepeatWrapping;ya[n.id]=l.createPattern(n.image,!0===p&&!0===q?"repeat":!0===p&&!1===q?"repeat-x":!1===p&&!0===q?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===ya[n.id]?e("rgba(0,0,0,1)"):e(ya[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,s=n.image.width*n.repeat.x,r=n.image.height*n.repeat.y,j=(j+p)*s,i=(1-i+q)*r,c=c-a,d=d-b,f=f-a,g=g-b,h=(h+p)*s-j,Y=(1-Y+q)*r-i,k=(k+p)*s-j,m=(1-m+q)*r-i,p=h*m-k*Y;0===p?(void 0===Pa[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,
|
|
|
-b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),Pa[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=Pa[n.id],j=4*(Math.floor(j)+Math.floor(i)*n.image.width),ja.setRGB(b[j]/255,b[j+1]/255,b[j+2]/255),w(ja)):(p=1/p,n=(m*c-Y*f)*p,Y=(m*d-Y*g)*p,c=(h*f-k*c)*p,d=(h*g-k*d)*p,a=a-n*j-c*i,j=b-Y*j-d*i,l.save(),l.transform(n,Y,c,d,a,j),l.fill(),l.restore())}}function I(a,b,c,d,e,f,g,j,i,h,Y,k,n){var m,p;m=n.width-1;p=n.height-1;g*=m;j*=p;c-=a;d-=b;e-=a;f-=b;i=i*m-g;h=h*p-
|
|
|
-j;Y=Y*m-g;k=k*p-j;p=1/(i*k-Y*h);m=(k*c-h*e)*p;h=(k*d-h*f)*p;c=(i*e-Y*c)*p;d=(i*f-Y*d)*p;a=a-m*g-c*j;b=b-h*g-d*j;l.save();l.transform(m,h,c,d,a,b);l.clip();l.drawImage(n,0,0);l.restore()}function gb(a,b,c,d){mb[0]=255*a.r|0;mb[1]=255*a.g|0;mb[2]=255*a.b|0;mb[4]=255*b.r|0;mb[5]=255*b.g|0;mb[6]=255*b.b|0;mb[8]=255*c.r|0;mb[9]=255*c.g|0;mb[10]=255*c.b|0;mb[12]=255*d.r|0;mb[13]=255*d.g|0;mb[14]=255*d.b|0;Ob.putImageData(rc,0,0);rb.drawImage(zb,0,0);return Ga}function ab(a,b,c){a=(a-b)/(c-b);return a*a*
|
|
|
-(3-2*a)}function hb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;0!==e&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}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();l.setTransform(1,0,0,-1,s,q);f.info.render.vertices=0;f.info.render.faces=0;g=k.projectScene(a,m,this.sortObjects,this.sortElements);i=g.elements;h=g.lights;Cb=0<h.length;if(!0===Cb){Qa.setRGB(0,0,0);kc.setRGB(0,0,0);
|
|
|
-Mb.setRGB(0,0,0);for(var fb=0,Nb=h.length;fb<Nb;fb++){var T=h[fb],U=T.color;T instanceof THREE.AmbientLight?Qa.add(U):T instanceof THREE.DirectionalLight?kc.add(U):T instanceof THREE.PointLight&&Mb.add(U)}}fb=0;for(Nb=i.length;fb<Nb;fb++){var ga=i[fb],T=ga.material;if(!(void 0===T||!1===T.visible)){Ka.makeEmpty();if(ga instanceof THREE.RenderableParticle){E=ga;E.x*=s;E.y*=q;var U=E,Xa=ga;b(T.opacity);c(T.blending);var ib=void 0,Ua=void 0,Ya=void 0,Va=void 0,Y=ga=void 0,dd=void 0;T instanceof THREE.ParticleBasicMaterial?
|
|
|
-null===T.map?(Ya=Xa.object.scale.x,Va=Xa.object.scale.y,Ya*=Xa.scale.x*s,Va*=Xa.scale.y*q,Ka.min.set(U.x-Ya,U.y-Va),Ka.max.set(U.x+Ya,U.y+Va),!1!==qb.isIntersectionBox(Ka)&&(e(T.color.getStyle()),l.save(),l.translate(U.x,U.y),l.rotate(-Xa.rotation),l.scale(Ya,Va),l.fillRect(-1,-1,2,2),l.restore())):(ga=T.map.image,Y=ga.width>>1,dd=ga.height>>1,Ya=Xa.scale.x*s,Va=Xa.scale.y*q,ib=Ya*Y,Ua=Va*dd,Ka.min.set(U.x-ib,U.y-Ua),Ka.max.set(U.x+ib,U.y+Ua),!1!==qb.isIntersectionBox(Ka)&&(l.save(),l.translate(U.x,
|
|
|
-U.y),l.rotate(-Xa.rotation),l.scale(Ya,-Va),l.translate(-Y,-dd),l.drawImage(ga,0,0),l.restore())):T instanceof THREE.ParticleCanvasMaterial&&(ib=Xa.scale.x*s,Ua=Xa.scale.y*q,Ka.min.set(U.x-ib,U.y-Ua),Ka.max.set(U.x+ib,U.y+Ua),!1!==qb.isIntersectionBox(Ka)&&(d(T.color.getStyle()),e(T.color.getStyle()),l.save(),l.translate(U.x,U.y),l.rotate(-Xa.rotation),l.scale(ib,Ua),T.program(l),l.restore()))}else if(ga instanceof THREE.RenderableLine)E=ga.v1,F=ga.v2,E.positionScreen.x*=s,E.positionScreen.y*=q,F.positionScreen.x*=
|
|
|
-s,F.positionScreen.y*=q,Ka.setFromPoints([E.positionScreen,F.positionScreen]),!0===qb.isIntersectionBox(Ka)&&(U=E,Xa=F,b(T.opacity),c(T.blending),l.beginPath(),l.moveTo(U.positionScreen.x,U.positionScreen.y),l.lineTo(Xa.positionScreen.x,Xa.positionScreen.y),T instanceof THREE.LineBasicMaterial&&(U=T.linewidth,H!==U&&(H=l.lineWidth=U),U=T.linecap,D!==U&&(D=l.lineCap=U),U=T.linejoin,y!==U&&(y=l.lineJoin=U),d(T.color.getStyle()),l.stroke(),Ka.expandByScalar(2*T.linewidth)));else if(ga instanceof THREE.RenderableFace3){E=
|
|
|
-ga.v1;F=ga.v2;G=ga.v3;if(-1>E.positionScreen.z||1<E.positionScreen.z)continue;if(-1>F.positionScreen.z||1<F.positionScreen.z)continue;if(-1>G.positionScreen.z||1<G.positionScreen.z)continue;E.positionScreen.x*=s;E.positionScreen.y*=q;F.positionScreen.x*=s;F.positionScreen.y*=q;G.positionScreen.x*=s;G.positionScreen.y*=q;!0===T.overdraw&&(hb(E.positionScreen,F.positionScreen),hb(F.positionScreen,G.positionScreen),hb(G.positionScreen,E.positionScreen));Ka.setFromPoints([E.positionScreen,F.positionScreen,
|
|
|
-G.positionScreen]);p(E,F,G,0,1,2,ga,T,a)}else if(ga instanceof THREE.RenderableFace4){E=ga.v1;F=ga.v2;G=ga.v3;W=ga.v4;if(-1>E.positionScreen.z||1<E.positionScreen.z)continue;if(-1>F.positionScreen.z||1<F.positionScreen.z)continue;if(-1>G.positionScreen.z||1<G.positionScreen.z)continue;if(-1>W.positionScreen.z||1<W.positionScreen.z)continue;E.positionScreen.x*=s;E.positionScreen.y*=q;F.positionScreen.x*=s;F.positionScreen.y*=q;G.positionScreen.x*=s;G.positionScreen.y*=q;W.positionScreen.x*=s;W.positionScreen.y*=
|
|
|
-q;A.positionScreen.copy(F.positionScreen);X.positionScreen.copy(W.positionScreen);!0===T.overdraw&&(hb(E.positionScreen,F.positionScreen),hb(F.positionScreen,W.positionScreen),hb(W.positionScreen,E.positionScreen),hb(G.positionScreen,A.positionScreen),hb(G.positionScreen,X.positionScreen));Ka.setFromPoints([E.positionScreen,F.positionScreen,G.positionScreen,W.positionScreen]);U=E;Xa=F;ib=G;Ua=W;Ya=A;Va=X;Y=a;f.info.render.vertices+=4;f.info.render.faces++;b(T.opacity);c(T.blending);void 0!==T.map&&
|
|
|
-null!==T.map||void 0!==T.envMap&&null!==T.envMap?(p(U,Xa,Ua,0,1,3,ga,T,Y),p(Ya,ib,Va,1,2,3,ga,T,Y)):(B=U.positionScreen.x,K=U.positionScreen.y,L=Xa.positionScreen.x,P=Xa.positionScreen.y,Z=ib.positionScreen.x,na=ib.positionScreen.y,pa=Ua.positionScreen.x,J=Ua.positionScreen.y,ha=Ya.positionScreen.x,ra=Ya.positionScreen.y,fa=Va.positionScreen.x,M=Va.positionScreen.y,T instanceof THREE.MeshLambertMaterial||T instanceof THREE.MeshPhongMaterial?(da.copy(T.color),xa.copy(T.emissive),T.vertexColors===THREE.FaceColors&&
|
|
|
-da.multiply(ga.color),!0===Cb?!1===T.wireframe&&T.shading==THREE.SmoothShading&&4==ga.vertexNormalsLength?(Ea.copy(Qa),Fa.copy(Qa),la.copy(Qa),qa.copy(Qa),n(ga.v1.positionWorld,ga.vertexNormalsModel[0],Ea),n(ga.v2.positionWorld,ga.vertexNormalsModel[1],Fa),n(ga.v4.positionWorld,ga.vertexNormalsModel[3],la),n(ga.v3.positionWorld,ga.vertexNormalsModel[2],qa),Ea.multiply(da).add(xa),Fa.multiply(da).add(xa),la.multiply(da).add(xa),qa.multiply(da).add(xa),sa=gb(Ea,Fa,la,qa),r(B,K,L,P,pa,J),I(B,K,L,P,pa,
|
|
|
-J,0,0,1,0,0,1,sa),r(ha,ra,Z,na,fa,M),I(ha,ra,Z,na,fa,M,1,0,1,1,0,1,sa)):(ja.copy(Qa),n(ga.centroidModel,ga.normalModel,ja),ja.multiply(da).add(xa),t(B,K,L,P,Z,na,pa,J),!0===T.wireframe?x(ja,T.wireframeLinewidth,T.wireframeLinecap,T.wireframeLinejoin):w(ja)):(ja.addColors(da,xa),t(B,K,L,P,Z,na,pa,J),!0===T.wireframe?x(ja,T.wireframeLinewidth,T.wireframeLinecap,T.wireframeLinejoin):w(ja))):T instanceof THREE.MeshBasicMaterial?(ja.copy(T.color),T.vertexColors===THREE.FaceColors&&ja.multiply(ga.color),
|
|
|
-t(B,K,L,P,Z,na,pa,J),!0===T.wireframe?x(ja,T.wireframeLinewidth,T.wireframeLinecap,T.wireframeLinejoin):w(ja)):T instanceof THREE.MeshNormalMaterial?(U=void 0,T.shading==THREE.FlatShading?(U=ga.normalModelView,ja.setRGB(U.x,U.y,U.z).multiplyScalar(0.5).addScalar(0.5),t(B,K,L,P,Z,na,pa,J),!0===T.wireframe?x(ja,T.wireframeLinewidth,T.wireframeLinecap,T.wireframeLinejoin):w(ja)):T.shading==THREE.SmoothShading&&(U=ga.vertexNormalsModelView[0],Ea.setRGB(U.x,U.y,U.z).multiplyScalar(0.5).addScalar(0.5),
|
|
|
-U=ga.vertexNormalsModelView[1],Fa.setRGB(U.x,U.y,U.z).multiplyScalar(0.5).addScalar(0.5),U=ga.vertexNormalsModelView[3],la.setRGB(U.x,U.y,U.z).multiplyScalar(0.5).addScalar(0.5),U=ga.vertexNormalsModelView[2],qa.setRGB(U.x,U.y,U.z).multiplyScalar(0.5).addScalar(0.5),sa=gb(Ea,Fa,la,qa),r(B,K,L,P,pa,J),I(B,K,L,P,pa,J,0,0,1,0,0,1,sa),r(ha,ra,Z,na,fa,M),I(ha,ra,Z,na,fa,M,1,0,1,1,0,1,sa))):T instanceof THREE.MeshDepthMaterial&&(ea=m.near,ua=m.far,Ea.r=Ea.g=Ea.b=1-ab(U.positionScreen.z*U.positionScreen.w,
|
|
|
-ea,ua),Fa.r=Fa.g=Fa.b=1-ab(Xa.positionScreen.z*Xa.positionScreen.w,ea,ua),la.r=la.g=la.b=1-ab(Ua.positionScreen.z*Ua.positionScreen.w,ea,ua),qa.r=qa.g=qa.b=1-ab(ib.positionScreen.z*ib.positionScreen.w,ea,ua),sa=gb(Ea,Fa,la,qa),r(B,K,L,P,pa,J),I(B,K,L,P,pa,J,0,0,1,0,0,1,sa),r(ha,ra,Z,na,fa,M),I(ha,ra,Z,na,fa,M,1,0,1,1,0,1,sa)))}Sa.union(Ka)}}l.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",
|
|
|
+document.createElement("canvas"),p,n,s,q,l=m.getContext("2d"),r=new THREE.Color(0),t=0,x=1,z=0,w=null,I=null,H=null,D=null,y=null,E,F,G,W,A=new THREE.RenderableVertex,X=new THREE.RenderableVertex,B,K,L,U,aa,ba,xa,J,ha,ua,Oa,M,fa=new THREE.Color,Da=new THREE.Color,Aa=new THREE.Color,Ia=new THREE.Color,Ja=new THREE.Color,ma=new THREE.Color,wa=new THREE.Color,Ta=new THREE.Color,Ra={},ia={},ra,ga,Z,pa,gb,hb,Ea,yb,Cb,Lb,Ua=new THREE.Box2,na=new THREE.Box2,Ya=new THREE.Box2,Db=!1,nb=new THREE.Color,kc=
|
|
|
+new THREE.Color,Mb=new THREE.Color,ib=new THREE.Vector3,zb,Ob,rc,ob,Fa,sb,pb=16;zb=document.createElement("canvas");zb.width=zb.height=2;Ob=zb.getContext("2d");Ob.fillStyle="rgba(0,0,0,1)";Ob.fillRect(0,0,2,2);rc=Ob.getImageData(0,0,2,2);ob=rc.data;Fa=document.createElement("canvas");Fa.width=Fa.height=pb;sb=Fa.getContext("2d");sb.translate(-pb/2,-pb/2);sb.scale(pb,pb);pb--;this.domElement=m;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.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){p=a*this.devicePixelRatio;n=b*this.devicePixelRatio;s=Math.floor(p/2);q=Math.floor(n/2);m.width=p;m.height=n;m.style.width=a+"px";m.style.height=b+"px";Ua.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q));na.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q));x=1;z=0;y=D=H=I=w=null};this.setClearColor=
|
|
|
+function(a,b){r.copy(a);t=void 0!==b?b:1;na.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q))};this.setClearColorHex=function(a,b){r.setHex(a);t=void 0!==b?b:1;na.set(new THREE.Vector2(-s,-q),new THREE.Vector2(s,q))};this.getMaxAnisotropy=function(){return 0};this.clear=function(){l.setTransform(1,0,0,-1,s,q);!1===na.empty()&&(na.intersect(Ua),na.expandByScalar(2),1>t&&l.clearRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0),0<t&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(255*
|
|
|
+r.r)+","+Math.floor(255*r.g)+","+Math.floor(255*r.b)+","+t+")"),l.fillRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0)),na.makeEmpty())};this.render=function(a,m){function n(a,b,c){for(var d=0,e=h.length;d<e;d++){var f=h[d];Ta.copy(f.color);if(f instanceof THREE.DirectionalLight){var g=f.matrixWorld.getPosition().normalize(),j=b.dot(g);0>=j||(j*=f.intensity,c.add(Ta.multiplyScalar(j)))}else f instanceof THREE.PointLight&&(g=f.matrixWorld.getPosition(),j=b.dot(ib.subVectors(g,a).normalize()),
|
|
|
+0>=j||(j*=0==f.distance?1:1-Math.min(a.distanceTo(g)/f.distance,1),0!=j&&(j*=f.intensity,c.add(Ta.multiplyScalar(j)))))}}function p(a,d,e,g,j,i,h,Y){f.info.render.vertices+=3;f.info.render.faces++;b(Y.opacity);c(Y.blending);B=a.positionScreen.x;K=a.positionScreen.y;L=d.positionScreen.x;U=d.positionScreen.y;aa=e.positionScreen.x;ba=e.positionScreen.y;r(B,K,L,U,aa,ba);(Y instanceof THREE.MeshLambertMaterial||Y instanceof THREE.MeshPhongMaterial)&&null===Y.map&&null===Y.map?(ma.copy(Y.color),wa.copy(Y.emissive),
|
|
|
+Y.vertexColors===THREE.FaceColors&&ma.multiply(h.color),!0===Db?!1===Y.wireframe&&Y.shading==THREE.SmoothShading&&3==h.vertexNormalsLength?(Da.copy(nb),Aa.copy(nb),Ia.copy(nb),n(h.v1.positionWorld,h.vertexNormalsModel[0],Da),n(h.v2.positionWorld,h.vertexNormalsModel[1],Aa),n(h.v3.positionWorld,h.vertexNormalsModel[2],Ia),Da.multiply(ma).add(wa),Aa.multiply(ma).add(wa),Ia.multiply(ma).add(wa),Ja.addColors(Aa,Ia).multiplyScalar(0.5),Z=jb(Da,Aa,Ia,Ja),I(B,K,L,U,aa,ba,0,0,1,0,0,1,Z)):(fa.copy(nb),n(h.centroidModel,
|
|
|
+h.normalModel,fa),fa.multiply(ma).add(wa),!0===Y.wireframe?x(fa,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(fa)):!0===Y.wireframe?x(Y.color,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(Y.color)):Y instanceof THREE.MeshBasicMaterial||Y instanceof THREE.MeshLambertMaterial||Y instanceof THREE.MeshPhongMaterial?null!==Y.map?Y.map.mapping instanceof THREE.UVMapping&&(pa=h.uvs[0],z(B,K,L,U,aa,ba,pa[g].x,pa[g].y,pa[j].x,pa[j].y,pa[i].x,pa[i].y,Y.map)):null!==Y.envMap?
|
|
|
+Y.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ib.copy(h.vertexNormalsModelView[g]),gb=0.5*ib.x+0.5,hb=0.5*ib.y+0.5,ib.copy(h.vertexNormalsModelView[j]),Ea=0.5*ib.x+0.5,yb=0.5*ib.y+0.5,ib.copy(h.vertexNormalsModelView[i]),Cb=0.5*ib.x+0.5,Lb=0.5*ib.y+0.5,z(B,K,L,U,aa,ba,gb,hb,Ea,yb,Cb,Lb,Y.envMap)):(fa.copy(Y.color),Y.vertexColors===THREE.FaceColors&&fa.multiply(h.color),!0===Y.wireframe?x(fa,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(fa)):Y instanceof THREE.MeshDepthMaterial?
|
|
|
+(ra=m.near,ga=m.far,j=1-cb(a.positionScreen.z*a.positionScreen.w,ra,ga),Da.setRGB(j,j,j),j=1-cb(d.positionScreen.z*d.positionScreen.w,ra,ga),Aa.setRGB(j,j,j),j=1-cb(e.positionScreen.z*e.positionScreen.w,ra,ga),Ia.setRGB(j,j,j),Ja.addColors(Aa,Ia).multiplyScalar(0.5),Z=jb(Da,Aa,Ia,Ja),I(B,K,L,U,aa,ba,0,0,1,0,0,1,Z)):Y instanceof THREE.MeshNormalMaterial&&(Y.shading==THREE.FlatShading?(d=h.normalModelView,fa.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),!0===Y.wireframe?x(fa,Y.wireframeLinewidth,
|
|
|
+Y.wireframeLinecap,Y.wireframeLinejoin):w(fa)):Y.shading==THREE.SmoothShading&&(d=h.vertexNormalsModelView[g],Da.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[j],Aa.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[i],Ia.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),Ja.addColors(Aa,Ia).multiplyScalar(0.5),Z=jb(Da,Aa,Ia,Ja),I(B,K,L,U,aa,ba,0,0,1,0,0,1,Z)))}function r(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);
|
|
|
+l.lineTo(e,f);l.closePath()}function t(a,b,c,d,e,f,g,j){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(g,j);l.closePath()}function x(a,b,c,e){H!==b&&(H=l.lineWidth=b);D!==c&&(D=l.lineCap=c);y!==e&&(y=l.lineJoin=e);d(a.getStyle());l.stroke();Ya.expandByScalar(2*b)}function w(a){e(a.getStyle());l.fill()}function z(a,b,c,d,f,g,j,i,h,Y,k,m,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,q=n.wrapT==
|
|
|
+THREE.RepeatWrapping;Ra[n.id]=l.createPattern(n.image,!0===p&&!0===q?"repeat":!0===p&&!1===q?"repeat-x":!1===p&&!0===q?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ra[n.id]?e("rgba(0,0,0,1)"):e(Ra[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,s=n.image.width*n.repeat.x,r=n.image.height*n.repeat.y,j=(j+p)*s,i=(1-i+q)*r,c=c-a,d=d-b,f=f-a,g=g-b,h=(h+p)*s-j,Y=(1-Y+q)*r-i,k=(k+p)*s-j,m=(1-m+q)*r-i,p=h*m-k*Y;0===p?(void 0===ia[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,
|
|
|
+b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),ia[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=ia[n.id],j=4*(Math.floor(j)+Math.floor(i)*n.image.width),fa.setRGB(b[j]/255,b[j+1]/255,b[j+2]/255),w(fa)):(p=1/p,n=(m*c-Y*f)*p,Y=(m*d-Y*g)*p,c=(h*f-k*c)*p,d=(h*g-k*d)*p,a=a-n*j-c*i,j=b-Y*j-d*i,l.save(),l.transform(n,Y,c,d,a,j),l.fill(),l.restore())}}function I(a,b,c,d,e,f,g,j,i,h,Y,k,n){var m,p;m=n.width-1;p=n.height-1;g*=m;j*=p;c-=a;d-=b;e-=a;f-=b;i=i*m-g;h=h*p-
|
|
|
+j;Y=Y*m-g;k=k*p-j;p=1/(i*k-Y*h);m=(k*c-h*e)*p;h=(k*d-h*f)*p;c=(i*e-Y*c)*p;d=(i*f-Y*d)*p;a=a-m*g-c*j;b=b-h*g-d*j;l.save();l.transform(m,h,c,d,a,b);l.clip();l.drawImage(n,0,0);l.restore()}function jb(a,b,c,d){ob[0]=255*a.r|0;ob[1]=255*a.g|0;ob[2]=255*a.b|0;ob[4]=255*b.r|0;ob[5]=255*b.g|0;ob[6]=255*b.b|0;ob[8]=255*c.r|0;ob[9]=255*c.g|0;ob[10]=255*c.b|0;ob[12]=255*d.r|0;ob[13]=255*d.g|0;ob[14]=255*d.b|0;Ob.putImageData(rc,0,0);sb.drawImage(zb,0,0);return Fa}function cb(a,b,c){a=(a-b)/(c-b);return a*a*
|
|
|
+(3-2*a)}function kb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;0!==e&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}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();l.setTransform(1,0,0,-1,s,q);f.info.render.vertices=0;f.info.render.faces=0;g=k.projectScene(a,m,this.sortObjects,this.sortElements);i=g.elements;h=g.lights;Db=0<h.length;if(!0===Db){nb.setRGB(0,0,0);kc.setRGB(0,0,0);
|
|
|
+Mb.setRGB(0,0,0);for(var pb=0,Nb=h.length;pb<Nb;pb++){var S=h[pb],T=S.color;S instanceof THREE.AmbientLight?nb.add(T):S instanceof THREE.DirectionalLight?kc.add(T):S instanceof THREE.PointLight&&Mb.add(T)}}pb=0;for(Nb=i.length;pb<Nb;pb++){var ja=i[pb],S=ja.material;if(!(void 0===S||!1===S.visible)){Ya.makeEmpty();if(ja instanceof THREE.RenderableParticle){E=ja;E.x*=s;E.y*=q;var T=E,Za=ja;b(S.opacity);c(S.blending);var Va=void 0,$a=void 0,Wa=void 0,Pa=void 0,Y=ja=void 0,dd=void 0;S instanceof THREE.ParticleBasicMaterial?
|
|
|
+null===S.map?(Wa=Za.object.scale.x,Pa=Za.object.scale.y,Wa*=Za.scale.x*s,Pa*=Za.scale.y*q,Ya.min.set(T.x-Wa,T.y-Pa),Ya.max.set(T.x+Wa,T.y+Pa),!1!==Ua.isIntersectionBox(Ya)&&(e(S.color.getStyle()),l.save(),l.translate(T.x,T.y),l.rotate(-Za.rotation),l.scale(Wa,Pa),l.fillRect(-1,-1,2,2),l.restore())):(ja=S.map.image,Y=ja.width>>1,dd=ja.height>>1,Wa=Za.scale.x*s,Pa=Za.scale.y*q,Va=Wa*Y,$a=Pa*dd,Ya.min.set(T.x-Va,T.y-$a),Ya.max.set(T.x+Va,T.y+$a),!1!==Ua.isIntersectionBox(Ya)&&(l.save(),l.translate(T.x,
|
|
|
+T.y),l.rotate(-Za.rotation),l.scale(Wa,-Pa),l.translate(-Y,-dd),l.drawImage(ja,0,0),l.restore())):S instanceof THREE.ParticleCanvasMaterial&&(Va=Za.scale.x*s,$a=Za.scale.y*q,Ya.min.set(T.x-Va,T.y-$a),Ya.max.set(T.x+Va,T.y+$a),!1!==Ua.isIntersectionBox(Ya)&&(d(S.color.getStyle()),e(S.color.getStyle()),l.save(),l.translate(T.x,T.y),l.rotate(-Za.rotation),l.scale(Va,$a),S.program(l),l.restore()))}else if(ja instanceof THREE.RenderableLine)E=ja.v1,F=ja.v2,E.positionScreen.x*=s,E.positionScreen.y*=q,F.positionScreen.x*=
|
|
|
+s,F.positionScreen.y*=q,Ya.setFromPoints([E.positionScreen,F.positionScreen]),!0===Ua.isIntersectionBox(Ya)&&(T=E,Za=F,b(S.opacity),c(S.blending),l.beginPath(),l.moveTo(T.positionScreen.x,T.positionScreen.y),l.lineTo(Za.positionScreen.x,Za.positionScreen.y),S instanceof THREE.LineBasicMaterial&&(T=S.linewidth,H!==T&&(H=l.lineWidth=T),T=S.linecap,D!==T&&(D=l.lineCap=T),T=S.linejoin,y!==T&&(y=l.lineJoin=T),d(S.color.getStyle()),l.stroke(),Ya.expandByScalar(2*S.linewidth)));else if(ja instanceof THREE.RenderableFace3){E=
|
|
|
+ja.v1;F=ja.v2;G=ja.v3;if(-1>E.positionScreen.z||1<E.positionScreen.z)continue;if(-1>F.positionScreen.z||1<F.positionScreen.z)continue;if(-1>G.positionScreen.z||1<G.positionScreen.z)continue;E.positionScreen.x*=s;E.positionScreen.y*=q;F.positionScreen.x*=s;F.positionScreen.y*=q;G.positionScreen.x*=s;G.positionScreen.y*=q;!0===S.overdraw&&(kb(E.positionScreen,F.positionScreen),kb(F.positionScreen,G.positionScreen),kb(G.positionScreen,E.positionScreen));Ya.setFromPoints([E.positionScreen,F.positionScreen,
|
|
|
+G.positionScreen]);p(E,F,G,0,1,2,ja,S,a)}else if(ja instanceof THREE.RenderableFace4){E=ja.v1;F=ja.v2;G=ja.v3;W=ja.v4;if(-1>E.positionScreen.z||1<E.positionScreen.z)continue;if(-1>F.positionScreen.z||1<F.positionScreen.z)continue;if(-1>G.positionScreen.z||1<G.positionScreen.z)continue;if(-1>W.positionScreen.z||1<W.positionScreen.z)continue;E.positionScreen.x*=s;E.positionScreen.y*=q;F.positionScreen.x*=s;F.positionScreen.y*=q;G.positionScreen.x*=s;G.positionScreen.y*=q;W.positionScreen.x*=s;W.positionScreen.y*=
|
|
|
+q;A.positionScreen.copy(F.positionScreen);X.positionScreen.copy(W.positionScreen);!0===S.overdraw&&(kb(E.positionScreen,F.positionScreen),kb(F.positionScreen,W.positionScreen),kb(W.positionScreen,E.positionScreen),kb(G.positionScreen,A.positionScreen),kb(G.positionScreen,X.positionScreen));Ya.setFromPoints([E.positionScreen,F.positionScreen,G.positionScreen,W.positionScreen]);T=E;Za=F;Va=G;$a=W;Wa=A;Pa=X;Y=a;f.info.render.vertices+=4;f.info.render.faces++;b(S.opacity);c(S.blending);void 0!==S.map&&
|
|
|
+null!==S.map||void 0!==S.envMap&&null!==S.envMap?(p(T,Za,$a,0,1,3,ja,S,Y),p(Wa,Va,Pa,1,2,3,ja,S,Y)):(B=T.positionScreen.x,K=T.positionScreen.y,L=Za.positionScreen.x,U=Za.positionScreen.y,aa=Va.positionScreen.x,ba=Va.positionScreen.y,xa=$a.positionScreen.x,J=$a.positionScreen.y,ha=Wa.positionScreen.x,ua=Wa.positionScreen.y,Oa=Pa.positionScreen.x,M=Pa.positionScreen.y,S instanceof THREE.MeshLambertMaterial||S instanceof THREE.MeshPhongMaterial?(ma.copy(S.color),wa.copy(S.emissive),S.vertexColors===
|
|
|
+THREE.FaceColors&&ma.multiply(ja.color),!0===Db?!1===S.wireframe&&S.shading==THREE.SmoothShading&&4==ja.vertexNormalsLength?(Da.copy(nb),Aa.copy(nb),Ia.copy(nb),Ja.copy(nb),n(ja.v1.positionWorld,ja.vertexNormalsModel[0],Da),n(ja.v2.positionWorld,ja.vertexNormalsModel[1],Aa),n(ja.v4.positionWorld,ja.vertexNormalsModel[3],Ia),n(ja.v3.positionWorld,ja.vertexNormalsModel[2],Ja),Da.multiply(ma).add(wa),Aa.multiply(ma).add(wa),Ia.multiply(ma).add(wa),Ja.multiply(ma).add(wa),Z=jb(Da,Aa,Ia,Ja),r(B,K,L,U,
|
|
|
+xa,J),I(B,K,L,U,xa,J,0,0,1,0,0,1,Z),r(ha,ua,aa,ba,Oa,M),I(ha,ua,aa,ba,Oa,M,1,0,1,1,0,1,Z)):(fa.copy(nb),n(ja.centroidModel,ja.normalModel,fa),fa.multiply(ma).add(wa),t(B,K,L,U,aa,ba,xa,J),!0===S.wireframe?x(fa,S.wireframeLinewidth,S.wireframeLinecap,S.wireframeLinejoin):w(fa)):(fa.addColors(ma,wa),t(B,K,L,U,aa,ba,xa,J),!0===S.wireframe?x(fa,S.wireframeLinewidth,S.wireframeLinecap,S.wireframeLinejoin):w(fa))):S instanceof THREE.MeshBasicMaterial?(fa.copy(S.color),S.vertexColors===THREE.FaceColors&&
|
|
|
+fa.multiply(ja.color),t(B,K,L,U,aa,ba,xa,J),!0===S.wireframe?x(fa,S.wireframeLinewidth,S.wireframeLinecap,S.wireframeLinejoin):w(fa)):S instanceof THREE.MeshNormalMaterial?(T=void 0,S.shading==THREE.FlatShading?(T=ja.normalModelView,fa.setRGB(T.x,T.y,T.z).multiplyScalar(0.5).addScalar(0.5),t(B,K,L,U,aa,ba,xa,J),!0===S.wireframe?x(fa,S.wireframeLinewidth,S.wireframeLinecap,S.wireframeLinejoin):w(fa)):S.shading==THREE.SmoothShading&&(T=ja.vertexNormalsModelView[0],Da.setRGB(T.x,T.y,T.z).multiplyScalar(0.5).addScalar(0.5),
|
|
|
+T=ja.vertexNormalsModelView[1],Aa.setRGB(T.x,T.y,T.z).multiplyScalar(0.5).addScalar(0.5),T=ja.vertexNormalsModelView[3],Ia.setRGB(T.x,T.y,T.z).multiplyScalar(0.5).addScalar(0.5),T=ja.vertexNormalsModelView[2],Ja.setRGB(T.x,T.y,T.z).multiplyScalar(0.5).addScalar(0.5),Z=jb(Da,Aa,Ia,Ja),r(B,K,L,U,xa,J),I(B,K,L,U,xa,J,0,0,1,0,0,1,Z),r(ha,ua,aa,ba,Oa,M),I(ha,ua,aa,ba,Oa,M,1,0,1,1,0,1,Z))):S instanceof THREE.MeshDepthMaterial&&(ra=m.near,ga=m.far,Da.r=Da.g=Da.b=1-cb(T.positionScreen.z*T.positionScreen.w,
|
|
|
+ra,ga),Aa.r=Aa.g=Aa.b=1-cb(Za.positionScreen.z*Za.positionScreen.w,ra,ga),Ia.r=Ia.g=Ia.b=1-cb($a.positionScreen.z*$a.positionScreen.w,ra,ga),Ja.r=Ja.g=Ja.b=1-cb(Va.positionScreen.z*Va.positionScreen.w,ra,ga),Z=jb(Da,Aa,Ia,Ja),r(B,K,L,U,xa,J),I(B,K,L,U,xa,J,0,0,1,0,0,1,Z),r(ha,ua,aa,ba,Oa,M),I(ha,ua,aa,ba,Oa,M,1,0,1,1,0,1,Z)))}na.union(Ya)}}l.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_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_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\nworldNormal = normalize( worldNormal );\nvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\nif ( useRefract ) {\nvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n} else {\nvReflect = reflect( cameraToVertex, worldNormal );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
|
|
@@ -338,16 +338,16 @@ n;c++)a.__morphTargetsArrays.push(new Float32Array(3*h))}if(a.numMorphNormals){a
|
|
|
"v3"===c.type?i=3:"v4"===c.type?i=4:"c"===c.type&&(i=3),c.size=i,c.array=new Float32Array(h*i),c.buffer=j.createBuffer(),c.buffer.belongsToAttribute=p,k.needsUpdate=!0,c.__original=k;a.__webglCustomAttributesList.push(c)}}a.__inittedArrays=!0}function e(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function f(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===
|
|
|
THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function g(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function i(a){var b,c,d;for(b in a.attributes)d="index"===b?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,c=a.attributes[b],c.buffer=j.createBuffer(),j.bindBuffer(d,c.buffer),j.bufferData(d,c.array,j.STATIC_DRAW)}function h(a,b,c){var d=a.attributes,e=d.index,f=d.position,g=d.normal,i=d.uv,h=d.color,d=d.tangent;a.elementsNeedUpdate&&
|
|
|
void 0!==e&&(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,e.array,b));a.verticesNeedUpdate&&void 0!==f&&(j.bindBuffer(j.ARRAY_BUFFER,f.buffer),j.bufferData(j.ARRAY_BUFFER,f.array,b));a.normalsNeedUpdate&&void 0!==g&&(j.bindBuffer(j.ARRAY_BUFFER,g.buffer),j.bufferData(j.ARRAY_BUFFER,g.array,b));a.uvsNeedUpdate&&void 0!==i&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),j.bufferData(j.ARRAY_BUFFER,i.array,b));a.colorsNeedUpdate&&void 0!==h&&(j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
-h.buffer),j.bufferData(j.ARRAY_BUFFER,h.array,b));a.tangentsNeedUpdate&&void 0!==d&&(j.bindBuffer(j.ARRAY_BUFFER,d.buffer),j.bufferData(j.ARRAY_BUFFER,d.array,b));if(c)for(var k in a.attributes)delete a.attributes[k].array}function k(a){pb[a]||(j.enableVertexAttribArray(a),pb[a]=!0)}function m(){for(var a in pb)pb[a]&&(j.disableVertexAttribArray(a),pb[a]=!1)}function p(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}function n(a,b){return b[0]-a[0]}function s(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)xa=
|
|
|
-Fa=null,qa=da=ea=Pa=eb=tb=ua=-1,rb=!0,a[d].render(b,c,kc,Mb),xa=Fa=null,qa=da=ea=Pa=eb=tb=ua=-1,rb=!0}function q(a,b,c,d,e,f,g,j){var i,h,k,n;b?(h=a.length-1,n=b=-1):(h=0,b=a.length,n=1);for(var m=h;m!==b;m+=n)if(i=a[m],i.render){h=i.object;k=i.buffer;if(j)i=j;else{i=i[c];if(!i)continue;g&&M.setBlending(i.blending,i.blendEquation,i.blendSrc,i.blendDst);M.setDepthTest(i.depthTest);M.setDepthWrite(i.depthWrite);F(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits)}M.setMaterialFaces(i);k instanceof
|
|
|
+h.buffer),j.bufferData(j.ARRAY_BUFFER,h.array,b));a.tangentsNeedUpdate&&void 0!==d&&(j.bindBuffer(j.ARRAY_BUFFER,d.buffer),j.bufferData(j.ARRAY_BUFFER,d.array,b));if(c)for(var k in a.attributes)delete a.attributes[k].array}function k(a){ib[a]||(j.enableVertexAttribArray(a),ib[a]=!0)}function m(){for(var a in ib)ib[a]&&(j.disableVertexAttribArray(a),ib[a]=!1)}function p(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}function n(a,b){return b[0]-a[0]}function s(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)wa=
|
|
|
+Aa=null,Ja=ma=ra=ia=Ea=hb=ga=-1,sb=!0,a[d].render(b,c,kc,Mb),wa=Aa=null,Ja=ma=ra=ia=Ea=hb=ga=-1,sb=!0}function q(a,b,c,d,e,f,g,j){var i,h,k,n;b?(h=a.length-1,n=b=-1):(h=0,b=a.length,n=1);for(var m=h;m!==b;m+=n)if(i=a[m],i.render){h=i.object;k=i.buffer;if(j)i=j;else{i=i[c];if(!i)continue;g&&M.setBlending(i.blending,i.blendEquation,i.blendSrc,i.blendDst);M.setDepthTest(i.depthTest);M.setDepthWrite(i.depthWrite);F(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits)}M.setMaterialFaces(i);k instanceof
|
|
|
THREE.BufferGeometry?M.renderBufferDirect(d,e,f,i,k,h):M.renderBuffer(d,e,f,i,k,h)}}function l(a,b,c,d,e,f,g){for(var j,i,h=0,k=a.length;h<k;h++)if(j=a[h],i=j.object,i.visible){if(g)j=g;else{j=j[b];if(!j)continue;f&&M.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);M.setDepthTest(j.depthTest);M.setDepthWrite(j.depthWrite);F(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}M.renderImmediateObject(c,d,e,j,i)}}function r(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
|
|
|
-function t(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function I(a,b,c,d,e){ya=0;d.needsUpdate&&(d.program&&Va(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,i=g.uniforms,h=d.uniforms;g!==Fa&&(j.useProgram(g),Fa=g,f=!0);d.id!==qa&&(qa=d.id,f=!0);if(f||a!==xa)j.uniformMatrix4fv(i.projectionMatrix,!1,a.projectionMatrix.elements),a!==xa&&(xa=a);if(d.skinning)if(ab&&e.useVertexTexture){if(null!==i.boneTexture){var k=H();j.uniform1i(i.boneTexture,k);M.setTexture(e.boneTexture,k)}}else null!==i.boneGlobalMatrices&&j.uniformMatrix4fv(i.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(h.fogColor.value=c.color,c instanceof THREE.Fog?
|
|
|
-(h.fogNear.value=c.near,h.fogFar.value=c.far):c instanceof THREE.FogExp2&&(h.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(rb){for(var n,m=k=0,l=0,p,q,s,r=fb,t=r.directional.colors,x=r.directional.positions,w=r.point.colors,z=r.point.positions,D=r.point.distances,B=r.spot.colors,F=r.spot.positions,G=r.spot.distances,I=r.spot.directions,J=r.spot.anglesCos,ja=r.spot.exponents,P=r.hemi.skyColors,T=r.hemi.groundColors,W=r.hemi.positions,
|
|
|
-X=0,U=0,da=0,ka=0,la=0,Ea=0,ga=0,ea=0,N=n=0,c=s=N=0,f=b.length;c<f;c++)n=b[c],n.onlyShadow||(p=n.color,q=n.intensity,s=n.distance,n instanceof THREE.AmbientLight?n.visible&&(M.gammaInput?(k+=p.r*p.r,m+=p.g*p.g,l+=p.b*p.b):(k+=p.r,m+=p.g,l+=p.b)):n instanceof THREE.DirectionalLight?(la+=1,n.visible&&(Ga.copy(n.matrixWorld.getPosition()),Ga.sub(n.target.matrixWorld.getPosition()),Ga.normalize(),0===Ga.x&&0===Ga.y&&0===Ga.z||(n=3*X,x[n]=Ga.x,x[n+1]=Ga.y,x[n+2]=Ga.z,M.gammaInput?y(t,n,p,q*q):E(t,n,p,
|
|
|
-q),X+=1))):n instanceof THREE.PointLight?(Ea+=1,n.visible&&(N=3*U,M.gammaInput?y(w,N,p,q*q):E(w,N,p,q),q=n.matrixWorld.getPosition(),z[N]=q.x,z[N+1]=q.y,z[N+2]=q.z,D[U]=s,U+=1)):n instanceof THREE.SpotLight?(ga+=1,n.visible&&(N=3*da,M.gammaInput?y(B,N,p,q*q):E(B,N,p,q),q=n.matrixWorld.getPosition(),F[N]=q.x,F[N+1]=q.y,F[N+2]=q.z,G[da]=s,Ga.copy(q),Ga.sub(n.target.matrixWorld.getPosition()),Ga.normalize(),I[N]=Ga.x,I[N+1]=Ga.y,I[N+2]=Ga.z,J[da]=Math.cos(n.angle),ja[da]=n.exponent,da+=1)):n instanceof
|
|
|
-THREE.HemisphereLight&&(ea+=1,n.visible&&(Ga.copy(n.matrixWorld.getPosition()),Ga.normalize(),0===Ga.x&&0===Ga.y&&0===Ga.z||(s=3*ka,W[s]=Ga.x,W[s+1]=Ga.y,W[s+2]=Ga.z,p=n.color,n=n.groundColor,M.gammaInput?(q*=q,y(P,s,p,q),y(T,s,n,q)):(E(P,s,p,q),E(T,s,n,q)),ka+=1))));c=3*X;for(f=Math.max(t.length,3*la);c<f;c++)t[c]=0;c=3*U;for(f=Math.max(w.length,3*Ea);c<f;c++)w[c]=0;c=3*da;for(f=Math.max(B.length,3*ga);c<f;c++)B[c]=0;c=3*ka;for(f=Math.max(P.length,3*ea);c<f;c++)P[c]=0;c=3*ka;for(f=Math.max(T.length,
|
|
|
-3*ea);c<f;c++)T[c]=0;r.directional.length=X;r.point.length=U;r.spot.length=da;r.hemi.length=ka;r.ambient[0]=k;r.ambient[1]=m;r.ambient[2]=l;rb=!1}c=fb;h.ambientLightColor.value=c.ambient;h.directionalLightColor.value=c.directional.colors;h.directionalLightDirection.value=c.directional.positions;h.pointLightColor.value=c.point.colors;h.pointLightPosition.value=c.point.positions;h.pointLightDistance.value=c.point.distances;h.spotLightColor.value=c.spot.colors;h.spotLightPosition.value=c.spot.positions;
|
|
|
+function t(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function I(a,b,c,d,e){Ra=0;d.needsUpdate&&(d.program&&Pa(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,i=g.uniforms,h=d.uniforms;g!==Aa&&(j.useProgram(g),Aa=g,f=!0);d.id!==Ja&&(Ja=d.id,f=!0);if(f||a!==wa)j.uniformMatrix4fv(i.projectionMatrix,!1,a.projectionMatrix.elements),a!==wa&&(wa=a);if(d.skinning)if(cb&&e.useVertexTexture){if(null!==i.boneTexture){var k=H();j.uniform1i(i.boneTexture,k);M.setTexture(e.boneTexture,k)}}else null!==i.boneGlobalMatrices&&j.uniformMatrix4fv(i.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(h.fogColor.value=c.color,c instanceof THREE.Fog?
|
|
|
+(h.fogNear.value=c.near,h.fogFar.value=c.far):c instanceof THREE.FogExp2&&(h.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(sb){for(var n,m=k=0,l=0,p,q,s,r=pb,t=r.directional.colors,x=r.directional.positions,w=r.point.colors,z=r.point.positions,D=r.point.distances,B=r.spot.colors,F=r.spot.positions,G=r.spot.distances,I=r.spot.directions,J=r.spot.anglesCos,fa=r.spot.exponents,S=r.hemi.skyColors,U=r.hemi.groundColors,W=r.hemi.positions,
|
|
|
+X=0,T=0,aa=0,ia=0,Da=0,ja=0,ma=0,ba=0,N=n=0,c=s=N=0,f=b.length;c<f;c++)n=b[c],n.onlyShadow||(p=n.color,q=n.intensity,s=n.distance,n instanceof THREE.AmbientLight?n.visible&&(M.gammaInput?(k+=p.r*p.r,m+=p.g*p.g,l+=p.b*p.b):(k+=p.r,m+=p.g,l+=p.b)):n instanceof THREE.DirectionalLight?(Da+=1,n.visible&&(Fa.copy(n.matrixWorld.getPosition()),Fa.sub(n.target.matrixWorld.getPosition()),Fa.normalize(),0===Fa.x&&0===Fa.y&&0===Fa.z||(n=3*X,x[n]=Fa.x,x[n+1]=Fa.y,x[n+2]=Fa.z,M.gammaInput?y(t,n,p,q*q):E(t,n,p,
|
|
|
+q),X+=1))):n instanceof THREE.PointLight?(ja+=1,n.visible&&(N=3*T,M.gammaInput?y(w,N,p,q*q):E(w,N,p,q),q=n.matrixWorld.getPosition(),z[N]=q.x,z[N+1]=q.y,z[N+2]=q.z,D[T]=s,T+=1)):n instanceof THREE.SpotLight?(ma+=1,n.visible&&(N=3*aa,M.gammaInput?y(B,N,p,q*q):E(B,N,p,q),q=n.matrixWorld.getPosition(),F[N]=q.x,F[N+1]=q.y,F[N+2]=q.z,G[aa]=s,Fa.copy(q),Fa.sub(n.target.matrixWorld.getPosition()),Fa.normalize(),I[N]=Fa.x,I[N+1]=Fa.y,I[N+2]=Fa.z,J[aa]=Math.cos(n.angle),fa[aa]=n.exponent,aa+=1)):n instanceof
|
|
|
+THREE.HemisphereLight&&(ba+=1,n.visible&&(Fa.copy(n.matrixWorld.getPosition()),Fa.normalize(),0===Fa.x&&0===Fa.y&&0===Fa.z||(s=3*ia,W[s]=Fa.x,W[s+1]=Fa.y,W[s+2]=Fa.z,p=n.color,n=n.groundColor,M.gammaInput?(q*=q,y(S,s,p,q),y(U,s,n,q)):(E(S,s,p,q),E(U,s,n,q)),ia+=1))));c=3*X;for(f=Math.max(t.length,3*Da);c<f;c++)t[c]=0;c=3*T;for(f=Math.max(w.length,3*ja);c<f;c++)w[c]=0;c=3*aa;for(f=Math.max(B.length,3*ma);c<f;c++)B[c]=0;c=3*ia;for(f=Math.max(S.length,3*ba);c<f;c++)S[c]=0;c=3*ia;for(f=Math.max(U.length,
|
|
|
+3*ba);c<f;c++)U[c]=0;r.directional.length=X;r.point.length=T;r.spot.length=aa;r.hemi.length=ia;r.ambient[0]=k;r.ambient[1]=m;r.ambient[2]=l;sb=!1}c=pb;h.ambientLightColor.value=c.ambient;h.directionalLightColor.value=c.directional.colors;h.directionalLightDirection.value=c.directional.positions;h.pointLightColor.value=c.point.colors;h.pointLightPosition.value=c.point.positions;h.pointLightDistance.value=c.point.distances;h.spotLightColor.value=c.spot.colors;h.spotLightPosition.value=c.spot.positions;
|
|
|
h.spotLightDistance.value=c.spot.distances;h.spotLightDirection.value=c.spot.directions;h.spotLightAngleCos.value=c.spot.anglesCos;h.spotLightExponent.value=c.spot.exponents;h.hemisphereLightSkyColor.value=c.hemi.skyColors;h.hemisphereLightGroundColor.value=c.hemi.groundColors;h.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){h.opacity.value=d.opacity;M.gammaInput?h.diffuse.value.copyGammaToLinear(d.color):
|
|
|
h.diffuse.value=d.color;h.map.value=d.map;h.lightMap.value=d.lightMap;h.specularMap.value=d.specularMap;d.bumpMap&&(h.bumpMap.value=d.bumpMap,h.bumpScale.value=d.bumpScale);d.normalMap&&(h.normalMap.value=d.normalMap,h.normalScale.value.copy(d.normalScale));var Z;d.map?Z=d.map:d.specularMap?Z=d.specularMap:d.normalMap?Z=d.normalMap:d.bumpMap&&(Z=d.bumpMap);void 0!==Z&&(c=Z.offset,Z=Z.repeat,h.offsetRepeat.value.set(c.x,c.y,Z.x,Z.y));h.envMap.value=d.envMap;h.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
|
|
|
1:-1;h.reflectivity.value=d.reflectivity;h.refractionRatio.value=d.refractionRatio;h.combine.value=d.combine;h.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(h.diffuse.value=d.color,h.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(h.diffuse.value=d.color,h.opacity.value=d.opacity,h.dashSize.value=d.dashSize,h.totalSize.value=d.dashSize+d.gapSize,h.scale.value=d.scale):d instanceof THREE.ParticleBasicMaterial?
|
|
@@ -360,8 +360,8 @@ new Float32Array(16*k.length));m=0;for(l=k.length;m<l;m++)k[m].flattenToArrayOff
|
|
|
c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(m=0;6>m;m++)M.autoScaleCubemaps&&!f?(l=k,r=m,t=c.image[m],w=ad,t.width<=w&&t.height<=w||(z=Math.max(t.width,t.height),x=Math.floor(t.width*w/z),w=Math.floor(t.height*w/z),z=document.createElement("canvas"),z.width=x,z.height=w,z.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,x,w),t=z),l[r]=t):k[m]=c.image[m];m=k[0];l=0===(m.width&m.width-1)&&0===(m.height&m.height-1);r=K(c.format);t=K(c.type);A(j.TEXTURE_CUBE_MAP,c,l);for(m=0;6>m;m++)if(f){w=
|
|
|
k[m].mipmaps;z=0;for(D=w.length;z<D;z++)x=w[z],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+m,z,r,x.width,x.height,0,x.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,r,r,t,k[m]);c.generateMipmaps&&l&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else r instanceof THREE.WebGLRenderTargetCube?(c=r,j.activeTexture(j.TEXTURE0+k),j.bindTexture(j.TEXTURE_CUBE_MAP,
|
|
|
c.__webglTexture)):M.setTexture(r,k)}else if("tv"===m){void 0===c._array&&(c._array=[]);m=0;for(l=c.value.length;m<l;m++)c._array[m]=H();j.uniform1iv(f,c._array);m=0;for(l=c.value.length;m<l;m++)r=c.value[m],k=c._array[m],r&&M.setTexture(r,k)}if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==i.cameraPosition)b=a.matrixWorld.getPosition(),j.uniform3f(i.cameraPosition,b.x,b.y,b.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||
|
|
|
-d instanceof THREE.ShaderMaterial||d.skinning)&&null!==i.viewMatrix&&j.uniformMatrix4fv(i.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(i.modelViewMatrix,!1,e._modelViewMatrix.elements);i.normalMatrix&&j.uniformMatrix3fv(i.normalMatrix,!1,e._normalMatrix.elements);null!==i.modelMatrix&&j.uniformMatrix4fv(i.modelMatrix,!1,e.matrixWorld.elements);return g}function H(){var a=ya;a>=Bc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Bc);
|
|
|
-ya+=1;return a}function D(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getInverse(a._modelViewMatrix);a._normalMatrix.transpose()}function y(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 E(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function F(a,b,c){Db!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),Db=a);if(a&&(yb!==b||Lb!==c))j.polygonOffset(b,c),yb=b,Lb=c}function G(a){for(var a=a.split("\n"),b=0,c=
|
|
|
+d instanceof THREE.ShaderMaterial||d.skinning)&&null!==i.viewMatrix&&j.uniformMatrix4fv(i.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(i.modelViewMatrix,!1,e._modelViewMatrix.elements);i.normalMatrix&&j.uniformMatrix3fv(i.normalMatrix,!1,e._normalMatrix.elements);null!==i.modelMatrix&&j.uniformMatrix4fv(i.modelMatrix,!1,e.matrixWorld.elements);return g}function H(){var a=Ra;a>=Bc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Bc);
|
|
|
+Ra+=1;return a}function D(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getInverse(a._modelViewMatrix);a._normalMatrix.transpose()}function y(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 E(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function F(a,b,c){yb!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),yb=a);if(a&&(Cb!==b||Lb!==c))j.polygonOffset(b,c),Cb=b,Lb=c}function G(a){for(var a=a.split("\n"),b=0,c=
|
|
|
a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function W(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(G(b)),null):c}function A(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,K(b.wrapS)),j.texParameteri(a,j.TEXTURE_WRAP_T,K(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,K(b.magFilter)),
|
|
|
j.texParameteri(a,j.TEXTURE_MIN_FILTER,K(b.minFilter))):(j.texParameteri(a,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,B(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,B(b.minFilter)));if(Eb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,Eb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Jc)),b.__oldAnisotropy=b.anisotropy}function X(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&
|
|
|
!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,j.RGBA4,b.width,b.height)}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
|
|
@@ -369,122 +369,122 @@ a===THREE.NearestMipMapLinearFilter?j.NEAREST:j.LINEAR}function K(a){if(a===THRE
|
|
|
if(a===THREE.LinearMipMapLinearFilter)return j.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return j.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return j.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return j.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return j.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return j.BYTE;if(a===THREE.ShortType)return j.SHORT;if(a===THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;
|
|
|
if(a===THREE.FloatType)return j.FLOAT;if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===
|
|
|
THREE.SrcColorFactor)return j.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;
|
|
|
-if(void 0!==Ab){if(a===THREE.RGB_S3TC_DXT1_Format)return Ab.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ab.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Ab.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ab.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},L=void 0!==a.canvas?a.canvas:document.createElement("canvas"),P=void 0!==a.precision?a.precision:"highp",Z=void 0!==
|
|
|
-a.alpha?a.alpha:!0,na=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,pa=void 0!==a.antialias?a.antialias:!1,J=void 0!==a.stencil?a.stencil:!0,ha=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ra=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),fa=void 0!==a.clearAlpha?a.clearAlpha:0;this.domElement=L;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.autoUpdateScene=
|
|
|
+if(void 0!==Ab){if(a===THREE.RGB_S3TC_DXT1_Format)return Ab.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ab.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Ab.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ab.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},L=void 0!==a.canvas?a.canvas:document.createElement("canvas"),U=void 0!==a.precision?a.precision:"highp",aa=void 0!==
|
|
|
+a.alpha?a.alpha:!0,ba=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,xa=void 0!==a.antialias?a.antialias:!1,J=void 0!==a.stencil?a.stencil:!0,ha=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ua=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),Oa=void 0!==a.clearAlpha?a.clearAlpha:0;this.domElement=L;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.autoUpdateScene=
|
|
|
this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=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,ja=[],Ea=0,Fa=null,la=null,qa=-1,da=null,xa=null,ka=0,ya=0,Pa=-1,ea=-1,ua=-1,sa=-1,lb=-1,Ja=-1,tb=-1,eb=-1,Db=null,yb=null,Lb=null,qb=null,Sa=0,Ka=0,Cb=0,Qa=0,kc=0,Mb=0,pb={},zb=new THREE.Frustum,Ob=new THREE.Matrix4,rc=new THREE.Matrix4,mb=new THREE.Vector3,Ga=new THREE.Vector3,rb=!0,fb={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:[]}},j,lc,sc,Eb,Ab;try{if(!(j=L.getContext("experimental-webgl",{alpha:Z,premultipliedAlpha:na,antialias:pa,stencil:J,preserveDrawingBuffer:ha})))throw"Error creating WebGL context.";}catch(bd){console.error(bd)}lc=j.getExtension("OES_texture_float");sc=j.getExtension("OES_standard_derivatives");Eb=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||
|
|
|
+geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,fa=[],Da=0,Aa=null,Ia=null,Ja=-1,ma=null,wa=null,Ta=0,Ra=0,ia=-1,ra=-1,ga=-1,Z=-1,pa=-1,gb=-1,hb=-1,Ea=-1,yb=null,Cb=null,Lb=null,Ua=null,na=0,Ya=0,Db=0,nb=0,kc=0,Mb=0,ib={},zb=new THREE.Frustum,Ob=new THREE.Matrix4,rc=new THREE.Matrix4,ob=new THREE.Vector3,Fa=new THREE.Vector3,sb=!0,pb={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:[]}},j,lc,sc,Eb,Ab;try{if(!(j=L.getContext("experimental-webgl",{alpha:aa,premultipliedAlpha:ba,antialias:xa,stencil:J,preserveDrawingBuffer:ha})))throw"Error creating WebGL context.";}catch(bd){console.error(bd)}lc=j.getExtension("OES_texture_float");sc=j.getExtension("OES_standard_derivatives");Eb=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||
|
|
|
j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ab=j.getExtension("WEBGL_compressed_texture_s3tc")||j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");lc||console.log("THREE.WebGLRenderer: Float textures not supported.");sc||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");Eb||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");Ab||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");
|
|
|
-j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(ra.r,ra.g,ra.b,fa);this.context=j;var Bc=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),$c=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var ad=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Jc=Eb?j.getParameter(Eb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
|
|
|
-0,gb=0<$c,ab=gb&&lc;Ab&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var hb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),cd=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var Nb=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),T=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,
|
|
|
-j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var U=0<hb.precision&&0<Nb.precision,ga=0<cd.precision&&0<T.precision;"highp"===P&&!U&&(ga?(P="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(P="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===
|
|
|
-P&&!ga&&(P="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return gb};this.supportsFloatTextures=function(){return lc};this.supportsStandardDerivatives=function(){return sc};this.supportsCompressedTextureS3TC=function(){return Ab};this.getMaxAnisotropy=function(){return Jc};this.getPrecision=function(){return P};this.setSize=function(a,b){L.width=a*this.devicePixelRatio;L.height=b*this.devicePixelRatio;
|
|
|
-L.style.width=a+"px";L.style.height=b+"px";this.setViewport(0,0,L.width,L.height)};this.setViewport=function(a,b,c,d){Sa=void 0!==a?a:0;Ka=void 0!==b?b:0;Cb=void 0!==c?c:L.width;Qa=void 0!==d?d:L.height;j.viewport(Sa,Ka,Cb,Qa)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColorHex=function(a,b){ra.setHex(a);fa=b;j.clearColor(ra.r,ra.g,ra.b,fa)};this.setClearColor=function(a,b){ra.copy(a);
|
|
|
-fa=b;j.clearColor(ra.r,ra.g,ra.b,fa)};this.getClearColor=function(){return ra};this.getClearAlpha=function(){return fa};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};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;qa=da=eb=tb=ua=-1;rb=!0;ea=Pa=-1;this.shadowMapPlugin.update(a,b)};var Xa=function(a){a=a.target;a.removeEventListener("dispose",Xa);a.__webglInit=void 0;void 0!==a.__webglVertexBuffer&&j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|
|
|
+j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(ua.r,ua.g,ua.b,Oa);this.context=j;var Bc=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),$c=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var ad=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Jc=Eb?j.getParameter(Eb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
|
|
|
+0,jb=0<$c,cb=jb&&lc;Ab&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var kb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),cd=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var Nb=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),S=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,
|
|
|
+j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var T=0<kb.precision&&0<Nb.precision,ja=0<cd.precision&&0<S.precision;"highp"===U&&!T&&(ja?(U="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(U="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===
|
|
|
+U&&!ja&&(U="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return jb};this.supportsFloatTextures=function(){return lc};this.supportsStandardDerivatives=function(){return sc};this.supportsCompressedTextureS3TC=function(){return Ab};this.getMaxAnisotropy=function(){return Jc};this.getPrecision=function(){return U};this.setSize=function(a,b){L.width=a*this.devicePixelRatio;L.height=b*this.devicePixelRatio;
|
|
|
+L.style.width=a+"px";L.style.height=b+"px";this.setViewport(0,0,L.width,L.height)};this.setViewport=function(a,b,c,d){na=void 0!==a?a:0;Ya=void 0!==b?b:0;Db=void 0!==c?c:L.width;nb=void 0!==d?d:L.height;j.viewport(na,Ya,Db,nb)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColorHex=function(a,b){ua.setHex(a);Oa=b;j.clearColor(ua.r,ua.g,ua.b,Oa)};this.setClearColor=function(a,b){ua.copy(a);
|
|
|
+Oa=b;j.clearColor(ua.r,ua.g,ua.b,Oa)};this.getClearColor=function(){return ua};this.getClearAlpha=function(){return Oa};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};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){Aa=null;Ja=ma=Ea=hb=ga=-1;sb=!0;ra=ia=-1;this.shadowMapPlugin.update(a,b)};var Za=function(a){a=a.target;a.removeEventListener("dispose",Za);a.__webglInit=void 0;void 0!==a.__webglVertexBuffer&&j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|
|
|
j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&j.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&j.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.geometryGroups)for(var c in a.geometryGroups){var d=
|
|
|
-a.geometryGroups[c];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)j.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals){e=0;for(f=d.numMorphNormals;e<f;e++)j.deleteBuffer(d.__webglMorphNormalsBuffers[e])}b(d)}b(a);M.info.memory.geometries--},ib=function(a){a=a.target;a.removeEventListener("dispose",ib);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));
|
|
|
-M.info.memory.textures--},Ua=function(a){a=a.target;a.removeEventListener("dispose",Ua);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);M.info.memory.textures--},Ya=function(a){a=a.target;a.removeEventListener("dispose",Ya);Va(a)},Va=function(a){var b=
|
|
|
-a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=ja.length;a<c;a++)if(d=ja[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ja.length;a<c;a++)d=ja[a],d.program!==b&&e.push(d);ja=e;j.deleteProgram(b);M.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&
|
|
|
+a.geometryGroups[c];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)j.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals){e=0;for(f=d.numMorphNormals;e<f;e++)j.deleteBuffer(d.__webglMorphNormalsBuffers[e])}b(d)}b(a);M.info.memory.geometries--},Va=function(a){a=a.target;a.removeEventListener("dispose",Va);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));
|
|
|
+M.info.memory.textures--},$a=function(a){a=a.target;a.removeEventListener("dispose",$a);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);M.info.memory.textures--},Wa=function(a){a=a.target;a.removeEventListener("dispose",Wa);Pa(a)},Pa=function(a){var b=
|
|
|
+a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=fa.length;a<c;a++)if(d=fa[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=fa.length;a<c;a++)d=fa[a],d.program!==b&&e.push(d);fa=e;j.deleteProgram(b);M.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&
|
|
|
(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,g,h,i,k,m,n,l,p,q=3*a.count;for(p=0;p<
|
|
|
q;p+=9)l=a.normalArray,d=l[p],e=l[p+1],f=l[p+2],g=l[p+3],i=l[p+4],m=l[p+5],h=l[p+6],k=l[p+7],n=l[p+8],d=(d+g+h)/3,e=(e+i+k)/3,f=(f+m+n)/3,l[p]=d,l[p+1]=e,l[p+2]=f,l[p+3]=d,l[p+4]=e,l[p+5]=f,l[p+6]=d,l[p+7]=e,l[p+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,a.uvArray,j.DYNAMIC_DRAW),
|
|
|
j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible)if(c=I(a,b,c,d,f),a=c.attributes,
|
|
|
-b=!1,d=16777215*e.id+2*c.id+(d.wireframe?1:0),d!==da&&(da=d,b=!0),b&&m(),f instanceof THREE.Mesh)if(f=e.attributes.index){d=e.offsets;1<d.length&&(b=!0);for(var c=0,g=d.length;c<g;c++){var h=d[c].index;if(b){var i=e.attributes.position,n=i.itemSize;j.bindBuffer(j.ARRAY_BUFFER,i.buffer);k(a.position);j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,4*h*n);n=e.attributes.normal;if(0<=a.normal&&n){var l=n.itemSize;j.bindBuffer(j.ARRAY_BUFFER,n.buffer);k(a.normal);j.vertexAttribPointer(a.normal,l,j.FLOAT,
|
|
|
+b=!1,d=16777215*e.id+2*c.id+(d.wireframe?1:0),d!==ma&&(ma=d,b=!0),b&&m(),f instanceof THREE.Mesh)if(f=e.attributes.index){d=e.offsets;1<d.length&&(b=!0);for(var c=0,g=d.length;c<g;c++){var h=d[c].index;if(b){var i=e.attributes.position,n=i.itemSize;j.bindBuffer(j.ARRAY_BUFFER,i.buffer);k(a.position);j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,4*h*n);n=e.attributes.normal;if(0<=a.normal&&n){var l=n.itemSize;j.bindBuffer(j.ARRAY_BUFFER,n.buffer);k(a.normal);j.vertexAttribPointer(a.normal,l,j.FLOAT,
|
|
|
!1,0,4*h*l)}n=e.attributes.uv;0<=a.uv&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.uv),j.vertexAttribPointer(a.uv,l,j.FLOAT,!1,0,4*h*l));n=e.attributes.color;0<=a.color&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.color),j.vertexAttribPointer(a.color,l,j.FLOAT,!1,0,4*h*l));n=e.attributes.tangent;0<=a.tangent&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.tangent),j.vertexAttribPointer(a.tangent,l,j.FLOAT,!1,0,4*h*l));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,f.buffer)}j.drawElements(j.TRIANGLES,
|
|
|
d[c].count,j.UNSIGNED_SHORT,2*d[c].start);M.info.render.calls++;M.info.render.vertices+=d[c].count;M.info.render.faces+=d[c].count/3}}else b&&(i=e.attributes.position,n=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),k(a.position),j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,0),n=e.attributes.normal,0<=a.normal&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.normal),j.vertexAttribPointer(a.normal,l,j.FLOAT,!1,0,0)),n=e.attributes.uv,0<=a.uv&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
n.buffer),k(a.uv),j.vertexAttribPointer(a.uv,l,j.FLOAT,!1,0,0)),n=e.attributes.color,0<=a.color&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.color),j.vertexAttribPointer(a.color,l,j.FLOAT,!1,0,0)),n=e.attributes.tangent,0<=a.tangent&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.tangent),j.vertexAttribPointer(a.tangent,l,j.FLOAT,!1,0,0))),j.drawArrays(j.TRIANGLES,0,i.numItems/3),M.info.render.calls++,M.info.render.vertices+=i.numItems/3,M.info.render.faces+=i.numItems/
|
|
|
3/3;else f instanceof THREE.ParticleSystem?b&&(i=e.attributes.position,n=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),k(a.position),j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,0),n=e.attributes.color,0<=a.color&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.color),j.vertexAttribPointer(a.color,l,j.FLOAT,!1,0,0)),j.drawArrays(j.POINTS,0,i.numItems/3),M.info.render.calls++,M.info.render.points+=i.numItems/3):f instanceof THREE.Line&&b&&(i=e.attributes.position,n=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
-i.buffer),k(a.position),j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,0),n=e.attributes.color,0<=a.color&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.color),j.vertexAttribPointer(a.color,l,j.FLOAT,!1,0,0)),j.drawArrays(j.LINE_STRIP,0,i.numItems/3),M.info.render.calls++,M.info.render.points+=i.numItems)};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,h,c=I(a,b,c,d,f),b=c.attributes,a=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==da&&(da=c,a=!0);a&&m();if(!d.morphTargets&&
|
|
|
+i.buffer),k(a.position),j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,0),n=e.attributes.color,0<=a.color&&n&&(l=n.itemSize,j.bindBuffer(j.ARRAY_BUFFER,n.buffer),k(a.color),j.vertexAttribPointer(a.color,l,j.FLOAT,!1,0,0)),j.drawArrays(j.LINE_STRIP,0,i.numItems/3),M.info.render.calls++,M.info.render.points+=i.numItems)};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,h,c=I(a,b,c,d,f),b=c.attributes,a=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==ma&&(ma=c,a=!0);a&&m();if(!d.morphTargets&&
|
|
|
0<=b.position)a&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),k(b.position),j.vertexAttribPointer(b.position,3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),k(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),k(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var i=
|
|
|
0;h=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;i<d.numSupportedMorphTargets&&i<h.length;)0<=c["morphTarget"+i]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[h[i]]),k(c["morphTarget"+i]),j.vertexAttribPointer(c["morphTarget"+i],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+i]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[h[i]]),k(c["morphNormal"+i]),j.vertexAttribPointer(c["morphNormal"+i],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=g[h[i]],i++}else{h=
|
|
|
[];g=f.morphTargetInfluences;var l,p=g.length;for(l=0;l<p;l++)i=g[l],0<i&&h.push([i,l]);h.length>d.numSupportedMorphTargets?(h.sort(n),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(n):0===h.length&&h.push([0,0]);for(i=0;i<d.numSupportedMorphTargets;)h[i]?(l=h[i][1],0<=c["morphTarget"+i]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l]),k(c["morphTarget"+i]),j.vertexAttribPointer(c["morphTarget"+i],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+i]&&d.morphNormals&&
|
|
|
(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l]),k(c["morphNormal"+i]),j.vertexAttribPointer(c["morphNormal"+i],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=g[l]):f.__webglMorphTargetInfluences[i]=0,i++}null!==d.program.uniforms.morphTargetInfluences&&j.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList){g=0;for(h=e.__webglCustomAttributesList.length;g<h;g++)c=e.__webglCustomAttributesList[g],0<=b[c.buffer.belongsToAttribute]&&
|
|
|
(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),k(b[c.buffer.belongsToAttribute]),j.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0))}0<=b.color&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),k(b.color),j.vertexAttribPointer(b.color,3,j.FLOAT,!1,0,0));0<=b.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),k(b.normal),j.vertexAttribPointer(b.normal,3,j.FLOAT,!1,0,0));0<=b.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),k(b.tangent),j.vertexAttribPointer(b.tangent,
|
|
|
4,j.FLOAT,!1,0,0));0<=b.uv&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),k(b.uv),j.vertexAttribPointer(b.uv,2,j.FLOAT,!1,0,0));0<=b.uv2&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),k(b.uv2),j.vertexAttribPointer(b.uv2,2,j.FLOAT,!1,0,0));d.skinning&&(0<=b.skinIndex&&0<=b.skinWeight)&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),k(b.skinIndex),j.vertexAttribPointer(b.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),k(b.skinWeight),j.vertexAttribPointer(b.skinWeight,
|
|
|
-4,j.FLOAT,!1,0,0));0<=b.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),k(b.lineDistance),j.vertexAttribPointer(b.lineDistance,1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(d=d.wireframeLinewidth,d!==qb&&(j.lineWidth(d),qb=d),a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,
|
|
|
-0)),M.info.render.calls++,M.info.render.vertices+=e.__webglFaceCount,M.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,d=d.linewidth,d!==qb&&(j.lineWidth(d),qb=d),j.drawArrays(f,0,e.__webglLineCount),M.info.render.calls++):f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),M.info.render.calls++,M.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),
|
|
|
-M.info.render.calls++)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,i=a.__lights,k=a.fog;qa=-1;rb=!0;this.autoUpdateScene&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ob.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zb.setFromMatrix(Ob);this.autoUpdateObjects&&this.initWebGLObjects(a);s(this.renderPluginsPre,
|
|
|
+4,j.FLOAT,!1,0,0));0<=b.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),k(b.lineDistance),j.vertexAttribPointer(b.lineDistance,1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(d=d.wireframeLinewidth,d!==Ua&&(j.lineWidth(d),Ua=d),a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,
|
|
|
+0)),M.info.render.calls++,M.info.render.vertices+=e.__webglFaceCount,M.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,d=d.linewidth,d!==Ua&&(j.lineWidth(d),Ua=d),j.drawArrays(f,0,e.__webglLineCount),M.info.render.calls++):f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),M.info.render.calls++,M.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),
|
|
|
+M.info.render.calls++)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,i=a.__lights,k=a.fog;Ja=-1;sb=!0;this.autoUpdateScene&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ob.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zb.setFromMatrix(Ob);this.autoUpdateObjects&&this.initWebGLObjects(a);s(this.renderPluginsPre,
|
|
|
a,b);M.info.render.calls=0;M.info.render.vertices=0;M.info.render.faces=0;M.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh||g instanceof THREE.ParticleSystem)||!g.frustumCulled||zb.intersectsObject(g))){D(g,b);var n=f,m=n.buffer,r=void 0,t=r=void 0,t=n.object.material;if(t instanceof THREE.MeshFaceMaterial)r=
|
|
|
-m.materialIndex,r=t.materials[r],r.transparent?(n.transparent=r,n.opaque=null):(n.opaque=r,n.transparent=null);else if(r=t)r.transparent?(n.transparent=r,n.opaque=null):(n.opaque=r,n.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(mb.copy(g.matrixWorld.getPosition()),mb.applyMatrix4(Ob),f.z=mb.z),f.id=g.id)}this.sortObjects&&h.sort(p);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(D(g,b),g=f.object.material,g.transparent?
|
|
|
+m.materialIndex,r=t.materials[r],r.transparent?(n.transparent=r,n.opaque=null):(n.opaque=r,n.transparent=null);else if(r=t)r.transparent?(n.transparent=r,n.opaque=null):(n.opaque=r,n.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ob.copy(g.matrixWorld.getPosition()),ob.applyMatrix4(Ob),f.z=ob.z),f.id=g.id)}this.sortObjects&&h.sort(p);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(D(g,b),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),F(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),q(a.__webglObjects,!1,"",b,i,k,!0,d),l(a.__webglObjectsImmediate,"",b,i,k,!1,d)):(d=null,this.setBlending(THREE.NoBlending),q(a.__webglObjects,!0,"opaque",b,i,k,!1,d),l(a.__webglObjectsImmediate,"opaque",
|
|
|
b,i,k,!1,d),q(a.__webglObjects,!1,"transparent",b,i,k,!0,d),l(a.__webglObjectsImmediate,"transparent",b,i,k,!0,d));s(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,
|
|
|
-null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=I(a,b,c,d,e);da=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,zb):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;){var b=a.__objectsAdded[0],k=a,m=void 0,l=void 0,p=void 0,q=void 0;
|
|
|
-if(!b.__webglInit)if(b.__webglInit=!0,b._modelViewMatrix=new THREE.Matrix4,b._normalMatrix=new THREE.Matrix3,void 0!==b.geometry&&void 0===b.geometry.__webglInit&&(b.geometry.__webglInit=!0,b.geometry.addEventListener("dispose",Xa)),b instanceof THREE.Mesh)if(l=b.geometry,p=b.material,l instanceof THREE.Geometry){if(void 0===l.geometryGroups){var s=l,y=void 0,A=void 0,D=void 0,B=void 0,F=void 0,E=void 0,G={},H=s.morphTargets.length,I=s.morphNormals.length,L=p instanceof THREE.MeshFaceMaterial;s.geometryGroups=
|
|
|
-{};y=0;for(A=s.faces.length;y<A;y++)D=s.faces[y],B=L?D.materialIndex:0,void 0===G[B]&&(G[B]={hash:B,counter:0}),E=G[B].hash+"_"+G[B].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:B,vertices:0,numMorphTargets:H,numMorphNormals:I}),F=D instanceof THREE.Face3?3:4,65535<s.geometryGroups[E].vertices+F&&(G[B].counter+=1,E=G[B].hash+"_"+G[B].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:B,vertices:0,numMorphTargets:H,
|
|
|
-numMorphNormals:I})),D instanceof THREE.Face3?s.geometryGroups[E].faces3.push(y):s.geometryGroups[E].faces4.push(y),s.geometryGroups[E].vertices+=F;s.geometryGroupsList=[];var K=void 0;for(K in s.geometryGroups)s.geometryGroups[K].id=ka++,s.geometryGroupsList.push(s.geometryGroups[K])}for(m in l.geometryGroups)if(q=l.geometryGroups[m],!q.__webglVertexBuffer){var J=q;J.__webglVertexBuffer=j.createBuffer();J.__webglNormalBuffer=j.createBuffer();J.__webglTangentBuffer=j.createBuffer();J.__webglColorBuffer=
|
|
|
-j.createBuffer();J.__webglUVBuffer=j.createBuffer();J.__webglUV2Buffer=j.createBuffer();J.__webglSkinIndicesBuffer=j.createBuffer();J.__webglSkinWeightsBuffer=j.createBuffer();J.__webglFaceBuffer=j.createBuffer();J.__webglLineBuffer=j.createBuffer();var P=void 0,ja=void 0;if(J.numMorphTargets){J.__webglMorphTargetsBuffers=[];P=0;for(ja=J.numMorphTargets;P<ja;P++)J.__webglMorphTargetsBuffers.push(j.createBuffer())}if(J.numMorphNormals){J.__webglMorphNormalsBuffers=[];P=0;for(ja=J.numMorphNormals;P<
|
|
|
-ja;P++)J.__webglMorphNormalsBuffers.push(j.createBuffer())}M.info.memory.geometries++;d(q,b);l.verticesNeedUpdate=!0;l.morphTargetsNeedUpdate=!0;l.elementsNeedUpdate=!0;l.uvsNeedUpdate=!0;l.normalsNeedUpdate=!0;l.tangentsNeedUpdate=!0;l.colorsNeedUpdate=!0}}else l instanceof THREE.BufferGeometry&&i(l);else if(b instanceof THREE.Ribbon){if(l=b.geometry,!l.__webglVertexBuffer){var T=l;T.__webglVertexBuffer=j.createBuffer();T.__webglColorBuffer=j.createBuffer();T.__webglNormalBuffer=j.createBuffer();
|
|
|
-M.info.memory.geometries++;var U=l,X=b,W=U.vertices.length;U.__vertexArray=new Float32Array(3*W);U.__colorArray=new Float32Array(3*W);U.__normalArray=new Float32Array(3*W);U.__webglVertexCount=W;c(U,X);l.verticesNeedUpdate=!0;l.colorsNeedUpdate=!0;l.normalsNeedUpdate=!0}}else if(b instanceof THREE.Line){if(l=b.geometry,!l.__webglVertexBuffer)if(l instanceof THREE.Geometry){var da=l;da.__webglVertexBuffer=j.createBuffer();da.__webglColorBuffer=j.createBuffer();da.__webglLineDistanceBuffer=j.createBuffer();
|
|
|
-M.info.memory.geometries++;var Z=l,Fa=b,la=Z.vertices.length;Z.__vertexArray=new Float32Array(3*la);Z.__colorArray=new Float32Array(3*la);Z.__lineDistanceArray=new Float32Array(1*la);Z.__webglLineCount=la;c(Z,Fa);l.verticesNeedUpdate=!0;l.colorsNeedUpdate=!0;l.lineDistancesNeedUpdate=!0}else l instanceof THREE.BufferGeometry&&i(l)}else if(b instanceof THREE.ParticleSystem&&(l=b.geometry,!l.__webglVertexBuffer))if(l instanceof THREE.Geometry){var xa=l;xa.__webglVertexBuffer=j.createBuffer();xa.__webglColorBuffer=
|
|
|
-j.createBuffer();M.info.memory.geometries++;var Ea=l,ga=b,qa=Ea.vertices.length;Ea.__vertexArray=new Float32Array(3*qa);Ea.__colorArray=new Float32Array(3*qa);Ea.__sortArray=[];Ea.__webglParticleCount=qa;c(Ea,ga);l.verticesNeedUpdate=!0;l.colorsNeedUpdate=!0}else l instanceof THREE.BufferGeometry&&i(l);if(!b.__webglActive){if(b instanceof THREE.Mesh)if(l=b.geometry,l instanceof THREE.BufferGeometry)r(k.__webglObjects,l,b);else{if(l instanceof THREE.Geometry)for(m in l.geometryGroups)q=l.geometryGroups[m],
|
|
|
-r(k.__webglObjects,q,b)}else b instanceof THREE.Ribbon||b instanceof THREE.Line||b instanceof THREE.ParticleSystem?(l=b.geometry,r(k.__webglObjects,l,b)):b instanceof THREE.ImmediateRenderObject||b.immediateRenderCallback?k.__webglObjectsImmediate.push({object:b,opaque:null,transparent:null}):b instanceof THREE.Sprite?k.__webglSprites.push(b):b instanceof THREE.LensFlare&&k.__webglFlares.push(b);b.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){var ea=a.__objectsRemoved[0],
|
|
|
-ya=a;ea instanceof THREE.Mesh||ea instanceof THREE.ParticleSystem||ea instanceof THREE.Ribbon||ea instanceof THREE.Line?z(ya.__webglObjects,ea):ea instanceof THREE.Sprite?w(ya.__webglSprites,ea):ea instanceof THREE.LensFlare?w(ya.__webglFlares,ea):(ea instanceof THREE.ImmediateRenderObject||ea.immediateRenderCallback)&&z(ya.__webglObjectsImmediate,ea);ea.__webglActive=!1;a.__objectsRemoved.splice(0,1)}for(var na=0,ua=a.__webglObjects.length;na<ua;na++){var ha=a.__webglObjects[na].object,N=ha.geometry,
|
|
|
-ra=void 0,sa=void 0,fa=void 0;if(ha instanceof THREE.Mesh)if(N instanceof THREE.BufferGeometry)(N.verticesNeedUpdate||N.elementsNeedUpdate||N.uvsNeedUpdate||N.normalsNeedUpdate||N.colorsNeedUpdate||N.tangentsNeedUpdate)&&h(N,j.DYNAMIC_DRAW,!N.dynamic),N.verticesNeedUpdate=!1,N.elementsNeedUpdate=!1,N.uvsNeedUpdate=!1,N.normalsNeedUpdate=!1,N.colorsNeedUpdate=!1,N.tangentsNeedUpdate=!1;else{for(var Pa=0,Ja=N.geometryGroupsList.length;Pa<Ja;Pa++)if(ra=N.geometryGroupsList[Pa],fa=e(ha,ra),N.buffersNeedUpdate&&
|
|
|
-d(ra,ha),sa=fa.attributes&&t(fa),N.verticesNeedUpdate||N.morphTargetsNeedUpdate||N.elementsNeedUpdate||N.uvsNeedUpdate||N.normalsNeedUpdate||N.colorsNeedUpdate||N.tangentsNeedUpdate||sa){var ta=ra,Ga=ha,pa=j.DYNAMIC_DRAW,Sa=!N.dynamic,Ka=fa;if(ta.__inittedArrays){var lb=f(Ka),fb=Ka.vertexColors?Ka.vertexColors:!1,pb=g(Ka),ib=lb===THREE.SmoothShading,C=void 0,V=void 0,Ua=void 0,O=void 0,Ya=void 0,Va=void 0,Qa=void 0,tb=void 0,eb=void 0,qb=void 0,rb=void 0,Q=void 0,R=void 0,S=void 0,oa=void 0,ab=void 0,
|
|
|
-gb=void 0,hb=void 0,yb=void 0,Pb=void 0,Qb=void 0,Rb=void 0,zb=void 0,Sb=void 0,Tb=void 0,Ub=void 0,Ab=void 0,Vb=void 0,Wb=void 0,Xb=void 0,Cb=void 0,Yb=void 0,Zb=void 0,$b=void 0,Db=void 0,za=void 0,Lb=void 0,mc=void 0,Eb=void 0,xc=void 0,bb=void 0,kc=void 0,Za=void 0,$a=void 0,nc=void 0,fc=void 0,Ra=0,Wa=0,gc=0,hc=0,Fb=0,nb=0,Ca=0,sb=0,Ta=0,aa=0,ia=0,v=0,Aa=void 0,cb=ta.__vertexArray,Mb=ta.__uvArray,Nb=ta.__uv2Array,Gb=ta.__normalArray,La=ta.__tangentArray,db=ta.__colorArray,Ma=ta.__skinIndexArray,
|
|
|
-Na=ta.__skinWeightArray,lc=ta.__morphTargetsArrays,sc=ta.__morphNormalsArrays,ed=ta.__webglCustomAttributesList,u=void 0,ac=ta.__faceArray,Bb=ta.__lineArray,ub=Ga.geometry,Jc=ub.elementsNeedUpdate,Bc=ub.uvsNeedUpdate,$c=ub.normalsNeedUpdate,ad=ub.tangentsNeedUpdate,bd=ub.colorsNeedUpdate,cd=ub.morphTargetsNeedUpdate,tc=ub.vertices,va=ta.faces3,wa=ta.faces4,ob=ub.faces,fd=ub.faceVertexUvs[0],gd=ub.faceVertexUvs[1],uc=ub.skinIndices,oc=ub.skinWeights,pc=ub.morphTargets,Kc=ub.morphNormals;if(ub.verticesNeedUpdate){C=
|
|
|
-0;for(V=va.length;C<V;C++)O=ob[va[C]],Q=tc[O.a],R=tc[O.b],S=tc[O.c],cb[Wa]=Q.x,cb[Wa+1]=Q.y,cb[Wa+2]=Q.z,cb[Wa+3]=R.x,cb[Wa+4]=R.y,cb[Wa+5]=R.z,cb[Wa+6]=S.x,cb[Wa+7]=S.y,cb[Wa+8]=S.z,Wa+=9;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],Q=tc[O.a],R=tc[O.b],S=tc[O.c],oa=tc[O.d],cb[Wa]=Q.x,cb[Wa+1]=Q.y,cb[Wa+2]=Q.z,cb[Wa+3]=R.x,cb[Wa+4]=R.y,cb[Wa+5]=R.z,cb[Wa+6]=S.x,cb[Wa+7]=S.y,cb[Wa+8]=S.z,cb[Wa+9]=oa.x,cb[Wa+10]=oa.y,cb[Wa+11]=oa.z,Wa+=12;j.bindBuffer(j.ARRAY_BUFFER,ta.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,
|
|
|
-cb,pa)}if(cd){bb=0;for(kc=pc.length;bb<kc;bb++){C=ia=0;for(V=va.length;C<V;C++)nc=va[C],O=ob[nc],Q=pc[bb].vertices[O.a],R=pc[bb].vertices[O.b],S=pc[bb].vertices[O.c],Za=lc[bb],Za[ia]=Q.x,Za[ia+1]=Q.y,Za[ia+2]=Q.z,Za[ia+3]=R.x,Za[ia+4]=R.y,Za[ia+5]=R.z,Za[ia+6]=S.x,Za[ia+7]=S.y,Za[ia+8]=S.z,Ka.morphNormals&&(ib?(fc=Kc[bb].vertexNormals[nc],Pb=fc.a,Qb=fc.b,Rb=fc.c):Rb=Qb=Pb=Kc[bb].faceNormals[nc],$a=sc[bb],$a[ia]=Pb.x,$a[ia+1]=Pb.y,$a[ia+2]=Pb.z,$a[ia+3]=Qb.x,$a[ia+4]=Qb.y,$a[ia+5]=Qb.z,$a[ia+6]=Rb.x,
|
|
|
-$a[ia+7]=Rb.y,$a[ia+8]=Rb.z),ia+=9;C=0;for(V=wa.length;C<V;C++)nc=wa[C],O=ob[nc],Q=pc[bb].vertices[O.a],R=pc[bb].vertices[O.b],S=pc[bb].vertices[O.c],oa=pc[bb].vertices[O.d],Za=lc[bb],Za[ia]=Q.x,Za[ia+1]=Q.y,Za[ia+2]=Q.z,Za[ia+3]=R.x,Za[ia+4]=R.y,Za[ia+5]=R.z,Za[ia+6]=S.x,Za[ia+7]=S.y,Za[ia+8]=S.z,Za[ia+9]=oa.x,Za[ia+10]=oa.y,Za[ia+11]=oa.z,Ka.morphNormals&&(ib?(fc=Kc[bb].vertexNormals[nc],Pb=fc.a,Qb=fc.b,Rb=fc.c,zb=fc.d):zb=Rb=Qb=Pb=Kc[bb].faceNormals[nc],$a=sc[bb],$a[ia]=Pb.x,$a[ia+1]=Pb.y,$a[ia+
|
|
|
-2]=Pb.z,$a[ia+3]=Qb.x,$a[ia+4]=Qb.y,$a[ia+5]=Qb.z,$a[ia+6]=Rb.x,$a[ia+7]=Rb.y,$a[ia+8]=Rb.z,$a[ia+9]=zb.x,$a[ia+10]=zb.y,$a[ia+11]=zb.z),ia+=12;j.bindBuffer(j.ARRAY_BUFFER,ta.__webglMorphTargetsBuffers[bb]);j.bufferData(j.ARRAY_BUFFER,lc[bb],pa);Ka.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,ta.__webglMorphNormalsBuffers[bb]),j.bufferData(j.ARRAY_BUFFER,sc[bb],pa))}}if(oc.length){C=0;for(V=va.length;C<V;C++)O=ob[va[C]],Vb=oc[O.a],Wb=oc[O.b],Xb=oc[O.c],Na[aa]=Vb.x,Na[aa+1]=Vb.y,Na[aa+2]=Vb.z,Na[aa+
|
|
|
-3]=Vb.w,Na[aa+4]=Wb.x,Na[aa+5]=Wb.y,Na[aa+6]=Wb.z,Na[aa+7]=Wb.w,Na[aa+8]=Xb.x,Na[aa+9]=Xb.y,Na[aa+10]=Xb.z,Na[aa+11]=Xb.w,Yb=uc[O.a],Zb=uc[O.b],$b=uc[O.c],Ma[aa]=Yb.x,Ma[aa+1]=Yb.y,Ma[aa+2]=Yb.z,Ma[aa+3]=Yb.w,Ma[aa+4]=Zb.x,Ma[aa+5]=Zb.y,Ma[aa+6]=Zb.z,Ma[aa+7]=Zb.w,Ma[aa+8]=$b.x,Ma[aa+9]=$b.y,Ma[aa+10]=$b.z,Ma[aa+11]=$b.w,aa+=12;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],Vb=oc[O.a],Wb=oc[O.b],Xb=oc[O.c],Cb=oc[O.d],Na[aa]=Vb.x,Na[aa+1]=Vb.y,Na[aa+2]=Vb.z,Na[aa+3]=Vb.w,Na[aa+4]=Wb.x,Na[aa+5]=Wb.y,Na[aa+
|
|
|
-6]=Wb.z,Na[aa+7]=Wb.w,Na[aa+8]=Xb.x,Na[aa+9]=Xb.y,Na[aa+10]=Xb.z,Na[aa+11]=Xb.w,Na[aa+12]=Cb.x,Na[aa+13]=Cb.y,Na[aa+14]=Cb.z,Na[aa+15]=Cb.w,Yb=uc[O.a],Zb=uc[O.b],$b=uc[O.c],Db=uc[O.d],Ma[aa]=Yb.x,Ma[aa+1]=Yb.y,Ma[aa+2]=Yb.z,Ma[aa+3]=Yb.w,Ma[aa+4]=Zb.x,Ma[aa+5]=Zb.y,Ma[aa+6]=Zb.z,Ma[aa+7]=Zb.w,Ma[aa+8]=$b.x,Ma[aa+9]=$b.y,Ma[aa+10]=$b.z,Ma[aa+11]=$b.w,Ma[aa+12]=Db.x,Ma[aa+13]=Db.y,Ma[aa+14]=Db.z,Ma[aa+15]=Db.w,aa+=16;0<aa&&(j.bindBuffer(j.ARRAY_BUFFER,ta.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
|
-Ma,pa),j.bindBuffer(j.ARRAY_BUFFER,ta.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Na,pa))}if(bd&&fb){C=0;for(V=va.length;C<V;C++)O=ob[va[C]],Qa=O.vertexColors,tb=O.color,3===Qa.length&&fb===THREE.VertexColors?(Sb=Qa[0],Tb=Qa[1],Ub=Qa[2]):Ub=Tb=Sb=tb,db[Ta]=Sb.r,db[Ta+1]=Sb.g,db[Ta+2]=Sb.b,db[Ta+3]=Tb.r,db[Ta+4]=Tb.g,db[Ta+5]=Tb.b,db[Ta+6]=Ub.r,db[Ta+7]=Ub.g,db[Ta+8]=Ub.b,Ta+=9;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],Qa=O.vertexColors,tb=O.color,4===Qa.length&&fb===THREE.VertexColors?(Sb=
|
|
|
-Qa[0],Tb=Qa[1],Ub=Qa[2],Ab=Qa[3]):Ab=Ub=Tb=Sb=tb,db[Ta]=Sb.r,db[Ta+1]=Sb.g,db[Ta+2]=Sb.b,db[Ta+3]=Tb.r,db[Ta+4]=Tb.g,db[Ta+5]=Tb.b,db[Ta+6]=Ub.r,db[Ta+7]=Ub.g,db[Ta+8]=Ub.b,db[Ta+9]=Ab.r,db[Ta+10]=Ab.g,db[Ta+11]=Ab.b,Ta+=12;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,ta.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,db,pa))}if(ad&&ub.hasTangents){C=0;for(V=va.length;C<V;C++)O=ob[va[C]],eb=O.vertexTangents,ab=eb[0],gb=eb[1],hb=eb[2],La[Ca]=ab.x,La[Ca+1]=ab.y,La[Ca+2]=ab.z,La[Ca+3]=ab.w,La[Ca+4]=gb.x,La[Ca+
|
|
|
-5]=gb.y,La[Ca+6]=gb.z,La[Ca+7]=gb.w,La[Ca+8]=hb.x,La[Ca+9]=hb.y,La[Ca+10]=hb.z,La[Ca+11]=hb.w,Ca+=12;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],eb=O.vertexTangents,ab=eb[0],gb=eb[1],hb=eb[2],yb=eb[3],La[Ca]=ab.x,La[Ca+1]=ab.y,La[Ca+2]=ab.z,La[Ca+3]=ab.w,La[Ca+4]=gb.x,La[Ca+5]=gb.y,La[Ca+6]=gb.z,La[Ca+7]=gb.w,La[Ca+8]=hb.x,La[Ca+9]=hb.y,La[Ca+10]=hb.z,La[Ca+11]=hb.w,La[Ca+12]=yb.x,La[Ca+13]=yb.y,La[Ca+14]=yb.z,La[Ca+15]=yb.w,Ca+=16;j.bindBuffer(j.ARRAY_BUFFER,ta.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,
|
|
|
-La,pa)}if($c&&lb){C=0;for(V=va.length;C<V;C++)if(O=ob[va[C]],Ya=O.vertexNormals,Va=O.normal,3===Ya.length&&ib)for(za=0;3>za;za++)mc=Ya[za],Gb[nb]=mc.x,Gb[nb+1]=mc.y,Gb[nb+2]=mc.z,nb+=3;else for(za=0;3>za;za++)Gb[nb]=Va.x,Gb[nb+1]=Va.y,Gb[nb+2]=Va.z,nb+=3;C=0;for(V=wa.length;C<V;C++)if(O=ob[wa[C]],Ya=O.vertexNormals,Va=O.normal,4===Ya.length&&ib)for(za=0;4>za;za++)mc=Ya[za],Gb[nb]=mc.x,Gb[nb+1]=mc.y,Gb[nb+2]=mc.z,nb+=3;else for(za=0;4>za;za++)Gb[nb]=Va.x,Gb[nb+1]=Va.y,Gb[nb+2]=Va.z,nb+=3;j.bindBuffer(j.ARRAY_BUFFER,
|
|
|
-ta.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Gb,pa)}if(Bc&&fd&&pb){C=0;for(V=va.length;C<V;C++)if(Ua=va[C],qb=fd[Ua],void 0!==qb)for(za=0;3>za;za++)Eb=qb[za],Mb[gc]=Eb.x,Mb[gc+1]=Eb.y,gc+=2;C=0;for(V=wa.length;C<V;C++)if(Ua=wa[C],qb=fd[Ua],void 0!==qb)for(za=0;4>za;za++)Eb=qb[za],Mb[gc]=Eb.x,Mb[gc+1]=Eb.y,gc+=2;0<gc&&(j.bindBuffer(j.ARRAY_BUFFER,ta.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,Mb,pa))}if(Bc&&gd&&pb){C=0;for(V=va.length;C<V;C++)if(Ua=va[C],rb=gd[Ua],void 0!==rb)for(za=0;3>za;za++)xc=
|
|
|
-rb[za],Nb[hc]=xc.x,Nb[hc+1]=xc.y,hc+=2;C=0;for(V=wa.length;C<V;C++)if(Ua=wa[C],rb=gd[Ua],void 0!==rb)for(za=0;4>za;za++)xc=rb[za],Nb[hc]=xc.x,Nb[hc+1]=xc.y,hc+=2;0<hc&&(j.bindBuffer(j.ARRAY_BUFFER,ta.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,Nb,pa))}if(Jc){C=0;for(V=va.length;C<V;C++)ac[Fb]=Ra,ac[Fb+1]=Ra+1,ac[Fb+2]=Ra+2,Fb+=3,Bb[sb]=Ra,Bb[sb+1]=Ra+1,Bb[sb+2]=Ra,Bb[sb+3]=Ra+2,Bb[sb+4]=Ra+1,Bb[sb+5]=Ra+2,sb+=6,Ra+=3;C=0;for(V=wa.length;C<V;C++)ac[Fb]=Ra,ac[Fb+1]=Ra+1,ac[Fb+2]=Ra+3,ac[Fb+3]=Ra+
|
|
|
-1,ac[Fb+4]=Ra+2,ac[Fb+5]=Ra+3,Fb+=6,Bb[sb]=Ra,Bb[sb+1]=Ra+1,Bb[sb+2]=Ra,Bb[sb+3]=Ra+3,Bb[sb+4]=Ra+1,Bb[sb+5]=Ra+2,Bb[sb+6]=Ra+2,Bb[sb+7]=Ra+3,sb+=8,Ra+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,ta.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,ac,pa);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,ta.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,pa)}if(ed){za=0;for(Lb=ed.length;za<Lb;za++)if(u=ed[za],u.__original.needsUpdate){v=0;if(1===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){C=
|
|
|
-0;for(V=va.length;C<V;C++)O=ob[va[C]],u.array[v]=u.value[O.a],u.array[v+1]=u.value[O.b],u.array[v+2]=u.value[O.c],v+=3;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],u.array[v]=u.value[O.a],u.array[v+1]=u.value[O.b],u.array[v+2]=u.value[O.c],u.array[v+3]=u.value[O.d],v+=4}else{if("faces"===u.boundTo){C=0;for(V=va.length;C<V;C++)Aa=u.value[va[C]],u.array[v]=Aa,u.array[v+1]=Aa,u.array[v+2]=Aa,v+=3;C=0;for(V=wa.length;C<V;C++)Aa=u.value[wa[C]],u.array[v]=Aa,u.array[v+1]=Aa,u.array[v+2]=Aa,u.array[v+3]=Aa,v+=
|
|
|
-4}}else if(2===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){C=0;for(V=va.length;C<V;C++)O=ob[va[C]],Q=u.value[O.a],R=u.value[O.b],S=u.value[O.c],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=R.x,u.array[v+3]=R.y,u.array[v+4]=S.x,u.array[v+5]=S.y,v+=6;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],Q=u.value[O.a],R=u.value[O.b],S=u.value[O.c],oa=u.value[O.d],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=R.x,u.array[v+3]=R.y,u.array[v+4]=S.x,u.array[v+5]=S.y,u.array[v+6]=oa.x,u.array[v+7]=oa.y,v+=8}else{if("faces"===
|
|
|
-u.boundTo){C=0;for(V=va.length;C<V;C++)S=R=Q=Aa=u.value[va[C]],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=R.x,u.array[v+3]=R.y,u.array[v+4]=S.x,u.array[v+5]=S.y,v+=6;C=0;for(V=wa.length;C<V;C++)oa=S=R=Q=Aa=u.value[wa[C]],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=R.x,u.array[v+3]=R.y,u.array[v+4]=S.x,u.array[v+5]=S.y,u.array[v+6]=oa.x,u.array[v+7]=oa.y,v+=8}}else if(3===u.size){var $;$="c"===u.type?["r","g","b"]:["x","y","z"];if(void 0===u.boundTo||"vertices"===u.boundTo){C=0;for(V=va.length;C<
|
|
|
-V;C++)O=ob[va[C]],Q=u.value[O.a],R=u.value[O.b],S=u.value[O.c],u.array[v]=Q[$[0]],u.array[v+1]=Q[$[1]],u.array[v+2]=Q[$[2]],u.array[v+3]=R[$[0]],u.array[v+4]=R[$[1]],u.array[v+5]=R[$[2]],u.array[v+6]=S[$[0]],u.array[v+7]=S[$[1]],u.array[v+8]=S[$[2]],v+=9;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],Q=u.value[O.a],R=u.value[O.b],S=u.value[O.c],oa=u.value[O.d],u.array[v]=Q[$[0]],u.array[v+1]=Q[$[1]],u.array[v+2]=Q[$[2]],u.array[v+3]=R[$[0]],u.array[v+4]=R[$[1]],u.array[v+5]=R[$[2]],u.array[v+6]=S[$[0]],
|
|
|
-u.array[v+7]=S[$[1]],u.array[v+8]=S[$[2]],u.array[v+9]=oa[$[0]],u.array[v+10]=oa[$[1]],u.array[v+11]=oa[$[2]],v+=12}else if("faces"===u.boundTo){C=0;for(V=va.length;C<V;C++)S=R=Q=Aa=u.value[va[C]],u.array[v]=Q[$[0]],u.array[v+1]=Q[$[1]],u.array[v+2]=Q[$[2]],u.array[v+3]=R[$[0]],u.array[v+4]=R[$[1]],u.array[v+5]=R[$[2]],u.array[v+6]=S[$[0]],u.array[v+7]=S[$[1]],u.array[v+8]=S[$[2]],v+=9;C=0;for(V=wa.length;C<V;C++)oa=S=R=Q=Aa=u.value[wa[C]],u.array[v]=Q[$[0]],u.array[v+1]=Q[$[1]],u.array[v+2]=Q[$[2]],
|
|
|
-u.array[v+3]=R[$[0]],u.array[v+4]=R[$[1]],u.array[v+5]=R[$[2]],u.array[v+6]=S[$[0]],u.array[v+7]=S[$[1]],u.array[v+8]=S[$[2]],u.array[v+9]=oa[$[0]],u.array[v+10]=oa[$[1]],u.array[v+11]=oa[$[2]],v+=12}else if("faceVertices"===u.boundTo){C=0;for(V=va.length;C<V;C++)Aa=u.value[va[C]],Q=Aa[0],R=Aa[1],S=Aa[2],u.array[v]=Q[$[0]],u.array[v+1]=Q[$[1]],u.array[v+2]=Q[$[2]],u.array[v+3]=R[$[0]],u.array[v+4]=R[$[1]],u.array[v+5]=R[$[2]],u.array[v+6]=S[$[0]],u.array[v+7]=S[$[1]],u.array[v+8]=S[$[2]],v+=9;C=0;
|
|
|
-for(V=wa.length;C<V;C++)Aa=u.value[wa[C]],Q=Aa[0],R=Aa[1],S=Aa[2],oa=Aa[3],u.array[v]=Q[$[0]],u.array[v+1]=Q[$[1]],u.array[v+2]=Q[$[2]],u.array[v+3]=R[$[0]],u.array[v+4]=R[$[1]],u.array[v+5]=R[$[2]],u.array[v+6]=S[$[0]],u.array[v+7]=S[$[1]],u.array[v+8]=S[$[2]],u.array[v+9]=oa[$[0]],u.array[v+10]=oa[$[1]],u.array[v+11]=oa[$[2]],v+=12}}else if(4===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){C=0;for(V=va.length;C<V;C++)O=ob[va[C]],Q=u.value[O.a],R=u.value[O.b],S=u.value[O.c],u.array[v]=Q.x,
|
|
|
-u.array[v+1]=Q.y,u.array[v+2]=Q.z,u.array[v+3]=Q.w,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+6]=R.z,u.array[v+7]=R.w,u.array[v+8]=S.x,u.array[v+9]=S.y,u.array[v+10]=S.z,u.array[v+11]=S.w,v+=12;C=0;for(V=wa.length;C<V;C++)O=ob[wa[C]],Q=u.value[O.a],R=u.value[O.b],S=u.value[O.c],oa=u.value[O.d],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=Q.z,u.array[v+3]=Q.w,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+6]=R.z,u.array[v+7]=R.w,u.array[v+8]=S.x,u.array[v+9]=S.y,u.array[v+10]=S.z,u.array[v+11]=S.w,u.array[v+
|
|
|
-12]=oa.x,u.array[v+13]=oa.y,u.array[v+14]=oa.z,u.array[v+15]=oa.w,v+=16}else if("faces"===u.boundTo){C=0;for(V=va.length;C<V;C++)S=R=Q=Aa=u.value[va[C]],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=Q.z,u.array[v+3]=Q.w,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+6]=R.z,u.array[v+7]=R.w,u.array[v+8]=S.x,u.array[v+9]=S.y,u.array[v+10]=S.z,u.array[v+11]=S.w,v+=12;C=0;for(V=wa.length;C<V;C++)oa=S=R=Q=Aa=u.value[wa[C]],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=Q.z,u.array[v+3]=Q.w,u.array[v+4]=R.x,
|
|
|
-u.array[v+5]=R.y,u.array[v+6]=R.z,u.array[v+7]=R.w,u.array[v+8]=S.x,u.array[v+9]=S.y,u.array[v+10]=S.z,u.array[v+11]=S.w,u.array[v+12]=oa.x,u.array[v+13]=oa.y,u.array[v+14]=oa.z,u.array[v+15]=oa.w,v+=16}else if("faceVertices"===u.boundTo){C=0;for(V=va.length;C<V;C++)Aa=u.value[va[C]],Q=Aa[0],R=Aa[1],S=Aa[2],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=Q.z,u.array[v+3]=Q.w,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+6]=R.z,u.array[v+7]=R.w,u.array[v+8]=S.x,u.array[v+9]=S.y,u.array[v+10]=S.z,u.array[v+
|
|
|
-11]=S.w,v+=12;C=0;for(V=wa.length;C<V;C++)Aa=u.value[wa[C]],Q=Aa[0],R=Aa[1],S=Aa[2],oa=Aa[3],u.array[v]=Q.x,u.array[v+1]=Q.y,u.array[v+2]=Q.z,u.array[v+3]=Q.w,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+6]=R.z,u.array[v+7]=R.w,u.array[v+8]=S.x,u.array[v+9]=S.y,u.array[v+10]=S.z,u.array[v+11]=S.w,u.array[v+12]=oa.x,u.array[v+13]=oa.y,u.array[v+14]=oa.z,u.array[v+15]=oa.w,v+=16}j.bindBuffer(j.ARRAY_BUFFER,u.buffer);j.bufferData(j.ARRAY_BUFFER,u.array,pa)}}Sa&&(delete ta.__inittedArrays,delete ta.__colorArray,
|
|
|
-delete ta.__normalArray,delete ta.__tangentArray,delete ta.__uvArray,delete ta.__uv2Array,delete ta.__faceArray,delete ta.__vertexArray,delete ta.__lineArray,delete ta.__skinIndexArray,delete ta.__skinWeightArray)}}N.verticesNeedUpdate=!1;N.morphTargetsNeedUpdate=!1;N.elementsNeedUpdate=!1;N.uvsNeedUpdate=!1;N.normalsNeedUpdate=!1;N.colorsNeedUpdate=!1;N.tangentsNeedUpdate=!1;N.buffersNeedUpdate=!1;fa.attributes&&x(fa)}else if(ha instanceof THREE.Ribbon){fa=e(ha,N);sa=fa.attributes&&t(fa);if(N.verticesNeedUpdate||
|
|
|
-N.colorsNeedUpdate||N.normalsNeedUpdate||sa){var Hb=N,Lc=j.DYNAMIC_DRAW,Cc=void 0,Dc=void 0,Ec=void 0,Mc=void 0,Ba=void 0,Nc=void 0,Oc=void 0,Pc=void 0,md=void 0,jb=void 0,yc=void 0,Ha=void 0,vb=void 0,nd=Hb.vertices,od=Hb.colors,pd=Hb.normals,yd=nd.length,zd=od.length,Ad=pd.length,Qc=Hb.__vertexArray,Rc=Hb.__colorArray,Sc=Hb.__normalArray,Bd=Hb.colorsNeedUpdate,Cd=Hb.normalsNeedUpdate,hd=Hb.__webglCustomAttributesList;if(Hb.verticesNeedUpdate){for(Cc=0;Cc<yd;Cc++)Mc=nd[Cc],Ba=3*Cc,Qc[Ba]=Mc.x,Qc[Ba+
|
|
|
-1]=Mc.y,Qc[Ba+2]=Mc.z;j.bindBuffer(j.ARRAY_BUFFER,Hb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Qc,Lc)}if(Bd){for(Dc=0;Dc<zd;Dc++)Nc=od[Dc],Ba=3*Dc,Rc[Ba]=Nc.r,Rc[Ba+1]=Nc.g,Rc[Ba+2]=Nc.b;j.bindBuffer(j.ARRAY_BUFFER,Hb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Rc,Lc)}if(Cd){for(Ec=0;Ec<Ad;Ec++)Oc=pd[Ec],Ba=3*Ec,Sc[Ba]=Oc.x,Sc[Ba+1]=Oc.y,Sc[Ba+2]=Oc.z;j.bindBuffer(j.ARRAY_BUFFER,Hb.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Sc,Lc)}if(hd){Pc=0;for(md=hd.length;Pc<md;Pc++)if(Ha=hd[Pc],
|
|
|
-Ha.needsUpdate&&(void 0===Ha.boundTo||"vertices"===Ha.boundTo)){Ba=0;yc=Ha.value.length;if(1===Ha.size)for(jb=0;jb<yc;jb++)Ha.array[jb]=Ha.value[jb];else if(2===Ha.size)for(jb=0;jb<yc;jb++)vb=Ha.value[jb],Ha.array[Ba]=vb.x,Ha.array[Ba+1]=vb.y,Ba+=2;else if(3===Ha.size)if("c"===Ha.type)for(jb=0;jb<yc;jb++)vb=Ha.value[jb],Ha.array[Ba]=vb.r,Ha.array[Ba+1]=vb.g,Ha.array[Ba+2]=vb.b,Ba+=3;else for(jb=0;jb<yc;jb++)vb=Ha.value[jb],Ha.array[Ba]=vb.x,Ha.array[Ba+1]=vb.y,Ha.array[Ba+2]=vb.z,Ba+=3;else if(4===
|
|
|
-Ha.size)for(jb=0;jb<yc;jb++)vb=Ha.value[jb],Ha.array[Ba]=vb.x,Ha.array[Ba+1]=vb.y,Ha.array[Ba+2]=vb.z,Ha.array[Ba+3]=vb.w,Ba+=4;j.bindBuffer(j.ARRAY_BUFFER,Ha.buffer);j.bufferData(j.ARRAY_BUFFER,Ha.array,Lc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.normalsNeedUpdate=!1;fa.attributes&&x(fa)}else if(ha instanceof THREE.Line)if(N instanceof THREE.BufferGeometry)(N.verticesNeedUpdate||N.colorsNeedUpdate)&&h(N,j.DYNAMIC_DRAW,!N.dynamic),N.verticesNeedUpdate=!1,N.colorsNeedUpdate=!1;else{fa=e(ha,
|
|
|
-N);sa=fa.attributes&&t(fa);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.lineDistancesNeedUpdate||sa){var Ib=N,Tc=j.DYNAMIC_DRAW,Fc=void 0,Gc=void 0,Hc=void 0,Uc=void 0,Oa=void 0,Vc=void 0,qd=Ib.vertices,rd=Ib.colors,sd=Ib.lineDistances,Dd=qd.length,Ed=rd.length,Fd=sd.length,Wc=Ib.__vertexArray,Xc=Ib.__colorArray,td=Ib.__lineDistanceArray,Gd=Ib.colorsNeedUpdate,Hd=Ib.lineDistancesNeedUpdate,id=Ib.__webglCustomAttributesList,Yc=void 0,ud=void 0,kb=void 0,zc=void 0,wb=void 0,Ia=void 0;if(Ib.verticesNeedUpdate){for(Fc=
|
|
|
-0;Fc<Dd;Fc++)Uc=qd[Fc],Oa=3*Fc,Wc[Oa]=Uc.x,Wc[Oa+1]=Uc.y,Wc[Oa+2]=Uc.z;j.bindBuffer(j.ARRAY_BUFFER,Ib.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Wc,Tc)}if(Gd){for(Gc=0;Gc<Ed;Gc++)Vc=rd[Gc],Oa=3*Gc,Xc[Oa]=Vc.r,Xc[Oa+1]=Vc.g,Xc[Oa+2]=Vc.b;j.bindBuffer(j.ARRAY_BUFFER,Ib.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Xc,Tc)}if(Hd){for(Hc=0;Hc<Fd;Hc++)td[Hc]=sd[Hc];j.bindBuffer(j.ARRAY_BUFFER,Ib.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,td,Tc)}if(id){Yc=0;for(ud=id.length;Yc<ud;Yc++)if(Ia=
|
|
|
-id[Yc],Ia.needsUpdate&&(void 0===Ia.boundTo||"vertices"===Ia.boundTo)){Oa=0;zc=Ia.value.length;if(1===Ia.size)for(kb=0;kb<zc;kb++)Ia.array[kb]=Ia.value[kb];else if(2===Ia.size)for(kb=0;kb<zc;kb++)wb=Ia.value[kb],Ia.array[Oa]=wb.x,Ia.array[Oa+1]=wb.y,Oa+=2;else if(3===Ia.size)if("c"===Ia.type)for(kb=0;kb<zc;kb++)wb=Ia.value[kb],Ia.array[Oa]=wb.r,Ia.array[Oa+1]=wb.g,Ia.array[Oa+2]=wb.b,Oa+=3;else for(kb=0;kb<zc;kb++)wb=Ia.value[kb],Ia.array[Oa]=wb.x,Ia.array[Oa+1]=wb.y,Ia.array[Oa+2]=wb.z,Oa+=3;else if(4===
|
|
|
-Ia.size)for(kb=0;kb<zc;kb++)wb=Ia.value[kb],Ia.array[Oa]=wb.x,Ia.array[Oa+1]=wb.y,Ia.array[Oa+2]=wb.z,Ia.array[Oa+3]=wb.w,Oa+=4;j.bindBuffer(j.ARRAY_BUFFER,Ia.buffer);j.bufferData(j.ARRAY_BUFFER,Ia.array,Tc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.lineDistancesNeedUpdate=!1;fa.attributes&&x(fa)}else if(ha instanceof THREE.ParticleSystem)if(N instanceof THREE.BufferGeometry)(N.verticesNeedUpdate||N.colorsNeedUpdate)&&h(N,j.DYNAMIC_DRAW,!N.dynamic),N.verticesNeedUpdate=!1,N.colorsNeedUpdate=
|
|
|
-!1;else{fa=e(ha,N);sa=fa.attributes&&t(fa);if(N.verticesNeedUpdate||N.colorsNeedUpdate||ha.sortParticles||sa){var bc=N,jd=j.DYNAMIC_DRAW,Ic=ha,xb=void 0,cc=void 0,dc=void 0,ca=void 0,ec=void 0,qc=void 0,Zc=bc.vertices,kd=Zc.length,ld=bc.colors,vd=ld.length,vc=bc.__vertexArray,wc=bc.__colorArray,ic=bc.__sortArray,wd=bc.verticesNeedUpdate,xd=bc.colorsNeedUpdate,jc=bc.__webglCustomAttributesList,Jb=void 0,Ac=void 0,ma=void 0,Kb=void 0,Da=void 0,ba=void 0;if(Ic.sortParticles){rc.copy(Ob);rc.multiply(Ic.matrixWorld);
|
|
|
-for(xb=0;xb<kd;xb++)dc=Zc[xb],mb.copy(dc),mb.applyMatrix4(rc),ic[xb]=[mb.z,xb];ic.sort(n);for(xb=0;xb<kd;xb++)dc=Zc[ic[xb][1]],ca=3*xb,vc[ca]=dc.x,vc[ca+1]=dc.y,vc[ca+2]=dc.z;for(cc=0;cc<vd;cc++)ca=3*cc,qc=ld[ic[cc][1]],wc[ca]=qc.r,wc[ca+1]=qc.g,wc[ca+2]=qc.b;if(jc){Jb=0;for(Ac=jc.length;Jb<Ac;Jb++)if(ba=jc[Jb],void 0===ba.boundTo||"vertices"===ba.boundTo)if(ca=0,Kb=ba.value.length,1===ba.size)for(ma=0;ma<Kb;ma++)ec=ic[ma][1],ba.array[ma]=ba.value[ec];else if(2===ba.size)for(ma=0;ma<Kb;ma++)ec=ic[ma][1],
|
|
|
-Da=ba.value[ec],ba.array[ca]=Da.x,ba.array[ca+1]=Da.y,ca+=2;else if(3===ba.size)if("c"===ba.type)for(ma=0;ma<Kb;ma++)ec=ic[ma][1],Da=ba.value[ec],ba.array[ca]=Da.r,ba.array[ca+1]=Da.g,ba.array[ca+2]=Da.b,ca+=3;else for(ma=0;ma<Kb;ma++)ec=ic[ma][1],Da=ba.value[ec],ba.array[ca]=Da.x,ba.array[ca+1]=Da.y,ba.array[ca+2]=Da.z,ca+=3;else if(4===ba.size)for(ma=0;ma<Kb;ma++)ec=ic[ma][1],Da=ba.value[ec],ba.array[ca]=Da.x,ba.array[ca+1]=Da.y,ba.array[ca+2]=Da.z,ba.array[ca+3]=Da.w,ca+=4}}else{if(wd)for(xb=0;xb<
|
|
|
-kd;xb++)dc=Zc[xb],ca=3*xb,vc[ca]=dc.x,vc[ca+1]=dc.y,vc[ca+2]=dc.z;if(xd)for(cc=0;cc<vd;cc++)qc=ld[cc],ca=3*cc,wc[ca]=qc.r,wc[ca+1]=qc.g,wc[ca+2]=qc.b;if(jc){Jb=0;for(Ac=jc.length;Jb<Ac;Jb++)if(ba=jc[Jb],ba.needsUpdate&&(void 0===ba.boundTo||"vertices"===ba.boundTo))if(Kb=ba.value.length,ca=0,1===ba.size)for(ma=0;ma<Kb;ma++)ba.array[ma]=ba.value[ma];else if(2===ba.size)for(ma=0;ma<Kb;ma++)Da=ba.value[ma],ba.array[ca]=Da.x,ba.array[ca+1]=Da.y,ca+=2;else if(3===ba.size)if("c"===ba.type)for(ma=0;ma<Kb;ma++)Da=
|
|
|
-ba.value[ma],ba.array[ca]=Da.r,ba.array[ca+1]=Da.g,ba.array[ca+2]=Da.b,ca+=3;else for(ma=0;ma<Kb;ma++)Da=ba.value[ma],ba.array[ca]=Da.x,ba.array[ca+1]=Da.y,ba.array[ca+2]=Da.z,ca+=3;else if(4===ba.size)for(ma=0;ma<Kb;ma++)Da=ba.value[ma],ba.array[ca]=Da.x,ba.array[ca+1]=Da.y,ba.array[ca+2]=Da.z,ba.array[ca+3]=Da.w,ca+=4}}if(wd||Ic.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,bc.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,vc,jd);if(xd||Ic.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,bc.__webglColorBuffer),
|
|
|
-j.bufferData(j.ARRAY_BUFFER,wc,jd);if(jc){Jb=0;for(Ac=jc.length;Jb<Ac;Jb++)if(ba=jc[Jb],ba.needsUpdate||Ic.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,ba.buffer),j.bufferData(j.ARRAY_BUFFER,ba.array,jd)}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;fa.attributes&&x(fa)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Ya);var i,k,n,l,m;a instanceof THREE.MeshDepthMaterial?m="depth":a instanceof THREE.MeshNormalMaterial?m="normal":a instanceof THREE.MeshBasicMaterial?m=
|
|
|
-"basic":a instanceof THREE.MeshLambertMaterial?m="lambert":a instanceof THREE.MeshPhongMaterial?m="phong":a instanceof THREE.LineBasicMaterial?m="basic":a instanceof THREE.LineDashedMaterial?m="dashed":a instanceof THREE.ParticleBasicMaterial&&(m="particle_basic");if(m){var p=THREE.ShaderLib[m];a.uniforms=THREE.UniformsUtils.clone(p.uniforms);a.vertexShader=p.vertexShader;a.fragmentShader=p.fragmentShader}var q,s,r;e=g=s=r=p=0;for(f=b.length;e<f;e++)q=b[e],q.onlyShadow||(q instanceof THREE.DirectionalLight&&
|
|
|
-g++,q instanceof THREE.PointLight&&s++,q instanceof THREE.SpotLight&&r++,q instanceof THREE.HemisphereLight&&p++);e=g;f=s;g=r;h=p;p=q=0;for(r=b.length;p<r;p++)s=b[p],s.castShadow&&(s instanceof THREE.SpotLight&&q++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&q++);l=q;ab&&d&&d.useVertexTexture?n=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+
|
|
|
-d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),n=b);a:{s=a.fragmentShader;r=a.vertexShader;p=a.uniforms;b=a.attributes;q=a.defines;var c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:n,useVertexTexture:ab&&d&&d.useVertexTexture,boneTextureWidth:d&&
|
|
|
-d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:l,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,
|
|
|
-doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},t,x,w,d=[];m?d.push(m):(d.push(s),d.push(r));for(x in q)d.push(x),d.push(q[x]);for(t in c)d.push(t),d.push(c[t]);m=d.join();t=0;for(x=ja.length;t<x;t++)if(d=ja[t],d.code===m){d.usedTimes++;k=d.program;break a}t="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?t="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(t="SHADOWMAP_TYPE_PCF_SOFT");x=[];for(w in q)d=q[w],!1!==d&&(d="#define "+w+" "+d,x.push(d));
|
|
|
-d=x.join("\n");w=j.createProgram();x=["precision "+P+" float;",d,gb?"#define VERTEX_TEXTURES":"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":
|
|
|
-"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.boneTextureWidth?"#define N_BONE_PIXEL_X "+c.boneTextureWidth.toFixed(1):"",c.boneTextureHeight?"#define N_BONE_PIXEL_Y "+c.boneTextureHeight.toFixed(1):"",c.morphTargets?"#define USE_MORPHTARGETS":
|
|
|
-"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
|
|
|
-t=["precision "+P+" float;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",d,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",
|
|
|
+null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=I(a,b,c,d,e);ma=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,zb):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;){var b=a.__objectsAdded[0],k=a,m=void 0,l=void 0,p=void 0,q=void 0;
|
|
|
+if(!b.__webglInit)if(b.__webglInit=!0,b._modelViewMatrix=new THREE.Matrix4,b._normalMatrix=new THREE.Matrix3,void 0!==b.geometry&&void 0===b.geometry.__webglInit&&(b.geometry.__webglInit=!0,b.geometry.addEventListener("dispose",Za)),b instanceof THREE.Mesh)if(l=b.geometry,p=b.material,l instanceof THREE.Geometry){if(void 0===l.geometryGroups){var s=l,y=void 0,A=void 0,D=void 0,B=void 0,F=void 0,E=void 0,G={},H=s.morphTargets.length,I=s.morphNormals.length,K=p instanceof THREE.MeshFaceMaterial;s.geometryGroups=
|
|
|
+{};y=0;for(A=s.faces.length;y<A;y++)D=s.faces[y],B=K?D.materialIndex:0,void 0===G[B]&&(G[B]={hash:B,counter:0}),E=G[B].hash+"_"+G[B].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:B,vertices:0,numMorphTargets:H,numMorphNormals:I}),F=D instanceof THREE.Face3?3:4,65535<s.geometryGroups[E].vertices+F&&(G[B].counter+=1,E=G[B].hash+"_"+G[B].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:B,vertices:0,numMorphTargets:H,
|
|
|
+numMorphNormals:I})),D instanceof THREE.Face3?s.geometryGroups[E].faces3.push(y):s.geometryGroups[E].faces4.push(y),s.geometryGroups[E].vertices+=F;s.geometryGroupsList=[];var L=void 0;for(L in s.geometryGroups)s.geometryGroups[L].id=Ta++,s.geometryGroupsList.push(s.geometryGroups[L])}for(m in l.geometryGroups)if(q=l.geometryGroups[m],!q.__webglVertexBuffer){var J=q;J.__webglVertexBuffer=j.createBuffer();J.__webglNormalBuffer=j.createBuffer();J.__webglTangentBuffer=j.createBuffer();J.__webglColorBuffer=
|
|
|
+j.createBuffer();J.__webglUVBuffer=j.createBuffer();J.__webglUV2Buffer=j.createBuffer();J.__webglSkinIndicesBuffer=j.createBuffer();J.__webglSkinWeightsBuffer=j.createBuffer();J.__webglFaceBuffer=j.createBuffer();J.__webglLineBuffer=j.createBuffer();var fa=void 0,S=void 0;if(J.numMorphTargets){J.__webglMorphTargetsBuffers=[];fa=0;for(S=J.numMorphTargets;fa<S;fa++)J.__webglMorphTargetsBuffers.push(j.createBuffer())}if(J.numMorphNormals){J.__webglMorphNormalsBuffers=[];fa=0;for(S=J.numMorphNormals;fa<
|
|
|
+S;fa++)J.__webglMorphNormalsBuffers.push(j.createBuffer())}M.info.memory.geometries++;d(q,b);l.verticesNeedUpdate=!0;l.morphTargetsNeedUpdate=!0;l.elementsNeedUpdate=!0;l.uvsNeedUpdate=!0;l.normalsNeedUpdate=!0;l.tangentsNeedUpdate=!0;l.colorsNeedUpdate=!0}}else l instanceof THREE.BufferGeometry&&i(l);else if(b instanceof THREE.Ribbon){if(l=b.geometry,!l.__webglVertexBuffer){var U=l;U.__webglVertexBuffer=j.createBuffer();U.__webglColorBuffer=j.createBuffer();U.__webglNormalBuffer=j.createBuffer();
|
|
|
+M.info.memory.geometries++;var T=l,X=b,W=T.vertices.length;T.__vertexArray=new Float32Array(3*W);T.__colorArray=new Float32Array(3*W);T.__normalArray=new Float32Array(3*W);T.__webglVertexCount=W;c(T,X);l.verticesNeedUpdate=!0;l.colorsNeedUpdate=!0;l.normalsNeedUpdate=!0}}else if(b instanceof THREE.Line){if(l=b.geometry,!l.__webglVertexBuffer)if(l instanceof THREE.Geometry){var Z=l;Z.__webglVertexBuffer=j.createBuffer();Z.__webglColorBuffer=j.createBuffer();Z.__webglLineDistanceBuffer=j.createBuffer();
|
|
|
+M.info.memory.geometries++;var aa=l,ia=b,Aa=aa.vertices.length;aa.__vertexArray=new Float32Array(3*Aa);aa.__colorArray=new Float32Array(3*Aa);aa.__lineDistanceArray=new Float32Array(1*Aa);aa.__webglLineCount=Aa;c(aa,ia);l.verticesNeedUpdate=!0;l.colorsNeedUpdate=!0;l.lineDistancesNeedUpdate=!0}else l instanceof THREE.BufferGeometry&&i(l)}else if(b instanceof THREE.ParticleSystem&&(l=b.geometry,!l.__webglVertexBuffer))if(l instanceof THREE.Geometry){var wa=l;wa.__webglVertexBuffer=j.createBuffer();
|
|
|
+wa.__webglColorBuffer=j.createBuffer();M.info.memory.geometries++;var Da=l,ja=b,ma=Da.vertices.length;Da.__vertexArray=new Float32Array(3*ma);Da.__colorArray=new Float32Array(3*ma);Da.__sortArray=[];Da.__webglParticleCount=ma;c(Da,ja);l.verticesNeedUpdate=!0;l.colorsNeedUpdate=!0}else l instanceof THREE.BufferGeometry&&i(l);if(!b.__webglActive){if(b instanceof THREE.Mesh)if(l=b.geometry,l instanceof THREE.BufferGeometry)r(k.__webglObjects,l,b);else{if(l instanceof THREE.Geometry)for(m in l.geometryGroups)q=
|
|
|
+l.geometryGroups[m],r(k.__webglObjects,q,b)}else b instanceof THREE.Ribbon||b instanceof THREE.Line||b instanceof THREE.ParticleSystem?(l=b.geometry,r(k.__webglObjects,l,b)):b instanceof THREE.ImmediateRenderObject||b.immediateRenderCallback?k.__webglObjectsImmediate.push({object:b,opaque:null,transparent:null}):b instanceof THREE.Sprite?k.__webglSprites.push(b):b instanceof THREE.LensFlare&&k.__webglFlares.push(b);b.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){var ba=
|
|
|
+a.__objectsRemoved[0],Ia=a;ba instanceof THREE.Mesh||ba instanceof THREE.ParticleSystem||ba instanceof THREE.Ribbon||ba instanceof THREE.Line?z(Ia.__webglObjects,ba):ba instanceof THREE.Sprite?w(Ia.__webglSprites,ba):ba instanceof THREE.LensFlare?w(Ia.__webglFlares,ba):(ba instanceof THREE.ImmediateRenderObject||ba.immediateRenderCallback)&&z(Ia.__webglObjectsImmediate,ba);ba.__webglActive=!1;a.__objectsRemoved.splice(0,1)}for(var Ja=0,ra=a.__webglObjects.length;Ja<ra;Ja++){var ha=a.__webglObjects[Ja].object,
|
|
|
+N=ha.geometry,Ra=void 0,pa=void 0,ga=void 0;if(ha instanceof THREE.Mesh)if(N instanceof THREE.BufferGeometry)(N.verticesNeedUpdate||N.elementsNeedUpdate||N.uvsNeedUpdate||N.normalsNeedUpdate||N.colorsNeedUpdate||N.tangentsNeedUpdate)&&h(N,j.DYNAMIC_DRAW,!N.dynamic),N.verticesNeedUpdate=!1,N.elementsNeedUpdate=!1,N.uvsNeedUpdate=!1,N.normalsNeedUpdate=!1,N.colorsNeedUpdate=!1,N.tangentsNeedUpdate=!1;else{for(var ua=0,Ea=N.geometryGroupsList.length;ua<Ea;ua++)if(Ra=N.geometryGroupsList[ua],ga=e(ha,
|
|
|
+Ra),N.buffersNeedUpdate&&d(Ra,ha),pa=ga.attributes&&t(ga),N.verticesNeedUpdate||N.morphTargetsNeedUpdate||N.elementsNeedUpdate||N.uvsNeedUpdate||N.normalsNeedUpdate||N.colorsNeedUpdate||N.tangentsNeedUpdate||pa){var qa=Ra,Fa=ha,na=j.DYNAMIC_DRAW,Oa=!N.dynamic,xa=ga;if(qa.__inittedArrays){var Ya=f(xa),gb=xa.vertexColors?xa.vertexColors:!1,pb=g(xa),ib=Ya===THREE.SmoothShading,C=void 0,V=void 0,Va=void 0,O=void 0,$a=void 0,Wa=void 0,Pa=void 0,nb=void 0,Ua=void 0,hb=void 0,sb=void 0,P=void 0,Q=void 0,
|
|
|
+R=void 0,oa=void 0,cb=void 0,jb=void 0,kb=void 0,yb=void 0,Pb=void 0,Qb=void 0,Rb=void 0,zb=void 0,Sb=void 0,Tb=void 0,Ub=void 0,Ab=void 0,Vb=void 0,Wb=void 0,Xb=void 0,Cb=void 0,Yb=void 0,Zb=void 0,$b=void 0,Db=void 0,va=void 0,Lb=void 0,mc=void 0,Eb=void 0,xc=void 0,db=void 0,kc=void 0,ab=void 0,bb=void 0,nc=void 0,fc=void 0,Qa=0,Xa=0,gc=0,hc=0,Fb=0,qb=0,Ba=0,tb=0,Sa=0,ca=0,ka=0,v=0,ya=void 0,eb=qa.__vertexArray,Mb=qa.__uvArray,Nb=qa.__uv2Array,Gb=qa.__normalArray,Ka=qa.__tangentArray,fb=qa.__colorArray,
|
|
|
+La=qa.__skinIndexArray,Ma=qa.__skinWeightArray,lc=qa.__morphTargetsArrays,sc=qa.__morphNormalsArrays,ed=qa.__webglCustomAttributesList,u=void 0,ac=qa.__faceArray,Bb=qa.__lineArray,ub=Fa.geometry,Jc=ub.elementsNeedUpdate,Bc=ub.uvsNeedUpdate,$c=ub.normalsNeedUpdate,ad=ub.tangentsNeedUpdate,bd=ub.colorsNeedUpdate,cd=ub.morphTargetsNeedUpdate,tc=ub.vertices,sa=qa.faces3,ta=qa.faces4,rb=ub.faces,fd=ub.faceVertexUvs[0],gd=ub.faceVertexUvs[1],uc=ub.skinIndices,oc=ub.skinWeights,pc=ub.morphTargets,Kc=ub.morphNormals;
|
|
|
+if(ub.verticesNeedUpdate){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],P=tc[O.a],Q=tc[O.b],R=tc[O.c],eb[Xa]=P.x,eb[Xa+1]=P.y,eb[Xa+2]=P.z,eb[Xa+3]=Q.x,eb[Xa+4]=Q.y,eb[Xa+5]=Q.z,eb[Xa+6]=R.x,eb[Xa+7]=R.y,eb[Xa+8]=R.z,Xa+=9;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],P=tc[O.a],Q=tc[O.b],R=tc[O.c],oa=tc[O.d],eb[Xa]=P.x,eb[Xa+1]=P.y,eb[Xa+2]=P.z,eb[Xa+3]=Q.x,eb[Xa+4]=Q.y,eb[Xa+5]=Q.z,eb[Xa+6]=R.x,eb[Xa+7]=R.y,eb[Xa+8]=R.z,eb[Xa+9]=oa.x,eb[Xa+10]=oa.y,eb[Xa+11]=oa.z,Xa+=12;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglVertexBuffer);
|
|
|
+j.bufferData(j.ARRAY_BUFFER,eb,na)}if(cd){db=0;for(kc=pc.length;db<kc;db++){C=ka=0;for(V=sa.length;C<V;C++)nc=sa[C],O=rb[nc],P=pc[db].vertices[O.a],Q=pc[db].vertices[O.b],R=pc[db].vertices[O.c],ab=lc[db],ab[ka]=P.x,ab[ka+1]=P.y,ab[ka+2]=P.z,ab[ka+3]=Q.x,ab[ka+4]=Q.y,ab[ka+5]=Q.z,ab[ka+6]=R.x,ab[ka+7]=R.y,ab[ka+8]=R.z,xa.morphNormals&&(ib?(fc=Kc[db].vertexNormals[nc],Pb=fc.a,Qb=fc.b,Rb=fc.c):Rb=Qb=Pb=Kc[db].faceNormals[nc],bb=sc[db],bb[ka]=Pb.x,bb[ka+1]=Pb.y,bb[ka+2]=Pb.z,bb[ka+3]=Qb.x,bb[ka+4]=Qb.y,
|
|
|
+bb[ka+5]=Qb.z,bb[ka+6]=Rb.x,bb[ka+7]=Rb.y,bb[ka+8]=Rb.z),ka+=9;C=0;for(V=ta.length;C<V;C++)nc=ta[C],O=rb[nc],P=pc[db].vertices[O.a],Q=pc[db].vertices[O.b],R=pc[db].vertices[O.c],oa=pc[db].vertices[O.d],ab=lc[db],ab[ka]=P.x,ab[ka+1]=P.y,ab[ka+2]=P.z,ab[ka+3]=Q.x,ab[ka+4]=Q.y,ab[ka+5]=Q.z,ab[ka+6]=R.x,ab[ka+7]=R.y,ab[ka+8]=R.z,ab[ka+9]=oa.x,ab[ka+10]=oa.y,ab[ka+11]=oa.z,xa.morphNormals&&(ib?(fc=Kc[db].vertexNormals[nc],Pb=fc.a,Qb=fc.b,Rb=fc.c,zb=fc.d):zb=Rb=Qb=Pb=Kc[db].faceNormals[nc],bb=sc[db],bb[ka]=
|
|
|
+Pb.x,bb[ka+1]=Pb.y,bb[ka+2]=Pb.z,bb[ka+3]=Qb.x,bb[ka+4]=Qb.y,bb[ka+5]=Qb.z,bb[ka+6]=Rb.x,bb[ka+7]=Rb.y,bb[ka+8]=Rb.z,bb[ka+9]=zb.x,bb[ka+10]=zb.y,bb[ka+11]=zb.z),ka+=12;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglMorphTargetsBuffers[db]);j.bufferData(j.ARRAY_BUFFER,lc[db],na);xa.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglMorphNormalsBuffers[db]),j.bufferData(j.ARRAY_BUFFER,sc[db],na))}}if(oc.length){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],Vb=oc[O.a],Wb=oc[O.b],Xb=oc[O.c],Ma[ca]=Vb.x,Ma[ca+1]=
|
|
|
+Vb.y,Ma[ca+2]=Vb.z,Ma[ca+3]=Vb.w,Ma[ca+4]=Wb.x,Ma[ca+5]=Wb.y,Ma[ca+6]=Wb.z,Ma[ca+7]=Wb.w,Ma[ca+8]=Xb.x,Ma[ca+9]=Xb.y,Ma[ca+10]=Xb.z,Ma[ca+11]=Xb.w,Yb=uc[O.a],Zb=uc[O.b],$b=uc[O.c],La[ca]=Yb.x,La[ca+1]=Yb.y,La[ca+2]=Yb.z,La[ca+3]=Yb.w,La[ca+4]=Zb.x,La[ca+5]=Zb.y,La[ca+6]=Zb.z,La[ca+7]=Zb.w,La[ca+8]=$b.x,La[ca+9]=$b.y,La[ca+10]=$b.z,La[ca+11]=$b.w,ca+=12;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],Vb=oc[O.a],Wb=oc[O.b],Xb=oc[O.c],Cb=oc[O.d],Ma[ca]=Vb.x,Ma[ca+1]=Vb.y,Ma[ca+2]=Vb.z,Ma[ca+3]=Vb.w,Ma[ca+4]=
|
|
|
+Wb.x,Ma[ca+5]=Wb.y,Ma[ca+6]=Wb.z,Ma[ca+7]=Wb.w,Ma[ca+8]=Xb.x,Ma[ca+9]=Xb.y,Ma[ca+10]=Xb.z,Ma[ca+11]=Xb.w,Ma[ca+12]=Cb.x,Ma[ca+13]=Cb.y,Ma[ca+14]=Cb.z,Ma[ca+15]=Cb.w,Yb=uc[O.a],Zb=uc[O.b],$b=uc[O.c],Db=uc[O.d],La[ca]=Yb.x,La[ca+1]=Yb.y,La[ca+2]=Yb.z,La[ca+3]=Yb.w,La[ca+4]=Zb.x,La[ca+5]=Zb.y,La[ca+6]=Zb.z,La[ca+7]=Zb.w,La[ca+8]=$b.x,La[ca+9]=$b.y,La[ca+10]=$b.z,La[ca+11]=$b.w,La[ca+12]=Db.x,La[ca+13]=Db.y,La[ca+14]=Db.z,La[ca+15]=Db.w,ca+=16;0<ca&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglSkinIndicesBuffer),
|
|
|
+j.bufferData(j.ARRAY_BUFFER,La,na),j.bindBuffer(j.ARRAY_BUFFER,qa.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Ma,na))}if(bd&&gb){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],Pa=O.vertexColors,nb=O.color,3===Pa.length&&gb===THREE.VertexColors?(Sb=Pa[0],Tb=Pa[1],Ub=Pa[2]):Ub=Tb=Sb=nb,fb[Sa]=Sb.r,fb[Sa+1]=Sb.g,fb[Sa+2]=Sb.b,fb[Sa+3]=Tb.r,fb[Sa+4]=Tb.g,fb[Sa+5]=Tb.b,fb[Sa+6]=Ub.r,fb[Sa+7]=Ub.g,fb[Sa+8]=Ub.b,Sa+=9;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],Pa=O.vertexColors,nb=O.color,4===Pa.length&&
|
|
|
+gb===THREE.VertexColors?(Sb=Pa[0],Tb=Pa[1],Ub=Pa[2],Ab=Pa[3]):Ab=Ub=Tb=Sb=nb,fb[Sa]=Sb.r,fb[Sa+1]=Sb.g,fb[Sa+2]=Sb.b,fb[Sa+3]=Tb.r,fb[Sa+4]=Tb.g,fb[Sa+5]=Tb.b,fb[Sa+6]=Ub.r,fb[Sa+7]=Ub.g,fb[Sa+8]=Ub.b,fb[Sa+9]=Ab.r,fb[Sa+10]=Ab.g,fb[Sa+11]=Ab.b,Sa+=12;0<Sa&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,fb,na))}if(ad&&ub.hasTangents){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],Ua=O.vertexTangents,cb=Ua[0],jb=Ua[1],kb=Ua[2],Ka[Ba]=cb.x,Ka[Ba+1]=cb.y,Ka[Ba+2]=cb.z,Ka[Ba+
|
|
|
+3]=cb.w,Ka[Ba+4]=jb.x,Ka[Ba+5]=jb.y,Ka[Ba+6]=jb.z,Ka[Ba+7]=jb.w,Ka[Ba+8]=kb.x,Ka[Ba+9]=kb.y,Ka[Ba+10]=kb.z,Ka[Ba+11]=kb.w,Ba+=12;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],Ua=O.vertexTangents,cb=Ua[0],jb=Ua[1],kb=Ua[2],yb=Ua[3],Ka[Ba]=cb.x,Ka[Ba+1]=cb.y,Ka[Ba+2]=cb.z,Ka[Ba+3]=cb.w,Ka[Ba+4]=jb.x,Ka[Ba+5]=jb.y,Ka[Ba+6]=jb.z,Ka[Ba+7]=jb.w,Ka[Ba+8]=kb.x,Ka[Ba+9]=kb.y,Ka[Ba+10]=kb.z,Ka[Ba+11]=kb.w,Ka[Ba+12]=yb.x,Ka[Ba+13]=yb.y,Ka[Ba+14]=yb.z,Ka[Ba+15]=yb.w,Ba+=16;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglTangentBuffer);
|
|
|
+j.bufferData(j.ARRAY_BUFFER,Ka,na)}if($c&&Ya){C=0;for(V=sa.length;C<V;C++)if(O=rb[sa[C]],$a=O.vertexNormals,Wa=O.normal,3===$a.length&&ib)for(va=0;3>va;va++)mc=$a[va],Gb[qb]=mc.x,Gb[qb+1]=mc.y,Gb[qb+2]=mc.z,qb+=3;else for(va=0;3>va;va++)Gb[qb]=Wa.x,Gb[qb+1]=Wa.y,Gb[qb+2]=Wa.z,qb+=3;C=0;for(V=ta.length;C<V;C++)if(O=rb[ta[C]],$a=O.vertexNormals,Wa=O.normal,4===$a.length&&ib)for(va=0;4>va;va++)mc=$a[va],Gb[qb]=mc.x,Gb[qb+1]=mc.y,Gb[qb+2]=mc.z,qb+=3;else for(va=0;4>va;va++)Gb[qb]=Wa.x,Gb[qb+1]=Wa.y,Gb[qb+
|
|
|
+2]=Wa.z,qb+=3;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Gb,na)}if(Bc&&fd&&pb){C=0;for(V=sa.length;C<V;C++)if(Va=sa[C],hb=fd[Va],void 0!==hb)for(va=0;3>va;va++)Eb=hb[va],Mb[gc]=Eb.x,Mb[gc+1]=Eb.y,gc+=2;C=0;for(V=ta.length;C<V;C++)if(Va=ta[C],hb=fd[Va],void 0!==hb)for(va=0;4>va;va++)Eb=hb[va],Mb[gc]=Eb.x,Mb[gc+1]=Eb.y,gc+=2;0<gc&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,Mb,na))}if(Bc&&gd&&pb){C=0;for(V=sa.length;C<V;C++)if(Va=
|
|
|
+sa[C],sb=gd[Va],void 0!==sb)for(va=0;3>va;va++)xc=sb[va],Nb[hc]=xc.x,Nb[hc+1]=xc.y,hc+=2;C=0;for(V=ta.length;C<V;C++)if(Va=ta[C],sb=gd[Va],void 0!==sb)for(va=0;4>va;va++)xc=sb[va],Nb[hc]=xc.x,Nb[hc+1]=xc.y,hc+=2;0<hc&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,Nb,na))}if(Jc){C=0;for(V=sa.length;C<V;C++)ac[Fb]=Qa,ac[Fb+1]=Qa+1,ac[Fb+2]=Qa+2,Fb+=3,Bb[tb]=Qa,Bb[tb+1]=Qa+1,Bb[tb+2]=Qa,Bb[tb+3]=Qa+2,Bb[tb+4]=Qa+1,Bb[tb+5]=Qa+2,tb+=6,Qa+=3;C=0;for(V=ta.length;C<V;C++)ac[Fb]=
|
|
|
+Qa,ac[Fb+1]=Qa+1,ac[Fb+2]=Qa+3,ac[Fb+3]=Qa+1,ac[Fb+4]=Qa+2,ac[Fb+5]=Qa+3,Fb+=6,Bb[tb]=Qa,Bb[tb+1]=Qa+1,Bb[tb+2]=Qa,Bb[tb+3]=Qa+3,Bb[tb+4]=Qa+1,Bb[tb+5]=Qa+2,Bb[tb+6]=Qa+2,Bb[tb+7]=Qa+3,tb+=8,Qa+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,qa.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,ac,na);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,qa.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,na)}if(ed){va=0;for(Lb=ed.length;va<Lb;va++)if(u=ed[va],u.__original.needsUpdate){v=0;if(1===u.size)if(void 0===
|
|
|
+u.boundTo||"vertices"===u.boundTo){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],u.array[v]=u.value[O.a],u.array[v+1]=u.value[O.b],u.array[v+2]=u.value[O.c],v+=3;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],u.array[v]=u.value[O.a],u.array[v+1]=u.value[O.b],u.array[v+2]=u.value[O.c],u.array[v+3]=u.value[O.d],v+=4}else{if("faces"===u.boundTo){C=0;for(V=sa.length;C<V;C++)ya=u.value[sa[C]],u.array[v]=ya,u.array[v+1]=ya,u.array[v+2]=ya,v+=3;C=0;for(V=ta.length;C<V;C++)ya=u.value[ta[C]],u.array[v]=ya,u.array[v+1]=
|
|
|
+ya,u.array[v+2]=ya,u.array[v+3]=ya,v+=4}}else if(2===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=Q.x,u.array[v+3]=Q.y,u.array[v+4]=R.x,u.array[v+5]=R.y,v+=6;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],oa=u.value[O.d],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=Q.x,u.array[v+3]=Q.y,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+
|
|
|
+6]=oa.x,u.array[v+7]=oa.y,v+=8}else{if("faces"===u.boundTo){C=0;for(V=sa.length;C<V;C++)R=Q=P=ya=u.value[sa[C]],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=Q.x,u.array[v+3]=Q.y,u.array[v+4]=R.x,u.array[v+5]=R.y,v+=6;C=0;for(V=ta.length;C<V;C++)oa=R=Q=P=ya=u.value[ta[C]],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=Q.x,u.array[v+3]=Q.y,u.array[v+4]=R.x,u.array[v+5]=R.y,u.array[v+6]=oa.x,u.array[v+7]=oa.y,v+=8}}else if(3===u.size){var $;$="c"===u.type?["r","g","b"]:["x","y","z"];if(void 0===u.boundTo||
|
|
|
+"vertices"===u.boundTo){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],u.array[v]=P[$[0]],u.array[v+1]=P[$[1]],u.array[v+2]=P[$[2]],u.array[v+3]=Q[$[0]],u.array[v+4]=Q[$[1]],u.array[v+5]=Q[$[2]],u.array[v+6]=R[$[0]],u.array[v+7]=R[$[1]],u.array[v+8]=R[$[2]],v+=9;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],oa=u.value[O.d],u.array[v]=P[$[0]],u.array[v+1]=P[$[1]],u.array[v+2]=P[$[2]],u.array[v+3]=Q[$[0]],u.array[v+4]=Q[$[1]],
|
|
|
+u.array[v+5]=Q[$[2]],u.array[v+6]=R[$[0]],u.array[v+7]=R[$[1]],u.array[v+8]=R[$[2]],u.array[v+9]=oa[$[0]],u.array[v+10]=oa[$[1]],u.array[v+11]=oa[$[2]],v+=12}else if("faces"===u.boundTo){C=0;for(V=sa.length;C<V;C++)R=Q=P=ya=u.value[sa[C]],u.array[v]=P[$[0]],u.array[v+1]=P[$[1]],u.array[v+2]=P[$[2]],u.array[v+3]=Q[$[0]],u.array[v+4]=Q[$[1]],u.array[v+5]=Q[$[2]],u.array[v+6]=R[$[0]],u.array[v+7]=R[$[1]],u.array[v+8]=R[$[2]],v+=9;C=0;for(V=ta.length;C<V;C++)oa=R=Q=P=ya=u.value[ta[C]],u.array[v]=P[$[0]],
|
|
|
+u.array[v+1]=P[$[1]],u.array[v+2]=P[$[2]],u.array[v+3]=Q[$[0]],u.array[v+4]=Q[$[1]],u.array[v+5]=Q[$[2]],u.array[v+6]=R[$[0]],u.array[v+7]=R[$[1]],u.array[v+8]=R[$[2]],u.array[v+9]=oa[$[0]],u.array[v+10]=oa[$[1]],u.array[v+11]=oa[$[2]],v+=12}else if("faceVertices"===u.boundTo){C=0;for(V=sa.length;C<V;C++)ya=u.value[sa[C]],P=ya[0],Q=ya[1],R=ya[2],u.array[v]=P[$[0]],u.array[v+1]=P[$[1]],u.array[v+2]=P[$[2]],u.array[v+3]=Q[$[0]],u.array[v+4]=Q[$[1]],u.array[v+5]=Q[$[2]],u.array[v+6]=R[$[0]],u.array[v+
|
|
|
+7]=R[$[1]],u.array[v+8]=R[$[2]],v+=9;C=0;for(V=ta.length;C<V;C++)ya=u.value[ta[C]],P=ya[0],Q=ya[1],R=ya[2],oa=ya[3],u.array[v]=P[$[0]],u.array[v+1]=P[$[1]],u.array[v+2]=P[$[2]],u.array[v+3]=Q[$[0]],u.array[v+4]=Q[$[1]],u.array[v+5]=Q[$[2]],u.array[v+6]=R[$[0]],u.array[v+7]=R[$[1]],u.array[v+8]=R[$[2]],u.array[v+9]=oa[$[0]],u.array[v+10]=oa[$[1]],u.array[v+11]=oa[$[2]],v+=12}}else if(4===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){C=0;for(V=sa.length;C<V;C++)O=rb[sa[C]],P=u.value[O.a],Q=
|
|
|
+u.value[O.b],R=u.value[O.c],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=P.z,u.array[v+3]=P.w,u.array[v+4]=Q.x,u.array[v+5]=Q.y,u.array[v+6]=Q.z,u.array[v+7]=Q.w,u.array[v+8]=R.x,u.array[v+9]=R.y,u.array[v+10]=R.z,u.array[v+11]=R.w,v+=12;C=0;for(V=ta.length;C<V;C++)O=rb[ta[C]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],oa=u.value[O.d],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=P.z,u.array[v+3]=P.w,u.array[v+4]=Q.x,u.array[v+5]=Q.y,u.array[v+6]=Q.z,u.array[v+7]=Q.w,u.array[v+8]=R.x,u.array[v+9]=
|
|
|
+R.y,u.array[v+10]=R.z,u.array[v+11]=R.w,u.array[v+12]=oa.x,u.array[v+13]=oa.y,u.array[v+14]=oa.z,u.array[v+15]=oa.w,v+=16}else if("faces"===u.boundTo){C=0;for(V=sa.length;C<V;C++)R=Q=P=ya=u.value[sa[C]],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=P.z,u.array[v+3]=P.w,u.array[v+4]=Q.x,u.array[v+5]=Q.y,u.array[v+6]=Q.z,u.array[v+7]=Q.w,u.array[v+8]=R.x,u.array[v+9]=R.y,u.array[v+10]=R.z,u.array[v+11]=R.w,v+=12;C=0;for(V=ta.length;C<V;C++)oa=R=Q=P=ya=u.value[ta[C]],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+
|
|
|
+2]=P.z,u.array[v+3]=P.w,u.array[v+4]=Q.x,u.array[v+5]=Q.y,u.array[v+6]=Q.z,u.array[v+7]=Q.w,u.array[v+8]=R.x,u.array[v+9]=R.y,u.array[v+10]=R.z,u.array[v+11]=R.w,u.array[v+12]=oa.x,u.array[v+13]=oa.y,u.array[v+14]=oa.z,u.array[v+15]=oa.w,v+=16}else if("faceVertices"===u.boundTo){C=0;for(V=sa.length;C<V;C++)ya=u.value[sa[C]],P=ya[0],Q=ya[1],R=ya[2],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=P.z,u.array[v+3]=P.w,u.array[v+4]=Q.x,u.array[v+5]=Q.y,u.array[v+6]=Q.z,u.array[v+7]=Q.w,u.array[v+8]=R.x,
|
|
|
+u.array[v+9]=R.y,u.array[v+10]=R.z,u.array[v+11]=R.w,v+=12;C=0;for(V=ta.length;C<V;C++)ya=u.value[ta[C]],P=ya[0],Q=ya[1],R=ya[2],oa=ya[3],u.array[v]=P.x,u.array[v+1]=P.y,u.array[v+2]=P.z,u.array[v+3]=P.w,u.array[v+4]=Q.x,u.array[v+5]=Q.y,u.array[v+6]=Q.z,u.array[v+7]=Q.w,u.array[v+8]=R.x,u.array[v+9]=R.y,u.array[v+10]=R.z,u.array[v+11]=R.w,u.array[v+12]=oa.x,u.array[v+13]=oa.y,u.array[v+14]=oa.z,u.array[v+15]=oa.w,v+=16}j.bindBuffer(j.ARRAY_BUFFER,u.buffer);j.bufferData(j.ARRAY_BUFFER,u.array,na)}}Oa&&
|
|
|
+(delete qa.__inittedArrays,delete qa.__colorArray,delete qa.__normalArray,delete qa.__tangentArray,delete qa.__uvArray,delete qa.__uv2Array,delete qa.__faceArray,delete qa.__vertexArray,delete qa.__lineArray,delete qa.__skinIndexArray,delete qa.__skinWeightArray)}}N.verticesNeedUpdate=!1;N.morphTargetsNeedUpdate=!1;N.elementsNeedUpdate=!1;N.uvsNeedUpdate=!1;N.normalsNeedUpdate=!1;N.colorsNeedUpdate=!1;N.tangentsNeedUpdate=!1;N.buffersNeedUpdate=!1;ga.attributes&&x(ga)}else if(ha instanceof THREE.Ribbon){ga=
|
|
|
+e(ha,N);pa=ga.attributes&&t(ga);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.normalsNeedUpdate||pa){var Hb=N,Lc=j.DYNAMIC_DRAW,Cc=void 0,Dc=void 0,Ec=void 0,Mc=void 0,za=void 0,Nc=void 0,Oc=void 0,Pc=void 0,md=void 0,lb=void 0,yc=void 0,Ga=void 0,vb=void 0,nd=Hb.vertices,od=Hb.colors,pd=Hb.normals,yd=nd.length,zd=od.length,Ad=pd.length,Qc=Hb.__vertexArray,Rc=Hb.__colorArray,Sc=Hb.__normalArray,Bd=Hb.colorsNeedUpdate,Cd=Hb.normalsNeedUpdate,hd=Hb.__webglCustomAttributesList;if(Hb.verticesNeedUpdate){for(Cc=
|
|
|
+0;Cc<yd;Cc++)Mc=nd[Cc],za=3*Cc,Qc[za]=Mc.x,Qc[za+1]=Mc.y,Qc[za+2]=Mc.z;j.bindBuffer(j.ARRAY_BUFFER,Hb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Qc,Lc)}if(Bd){for(Dc=0;Dc<zd;Dc++)Nc=od[Dc],za=3*Dc,Rc[za]=Nc.r,Rc[za+1]=Nc.g,Rc[za+2]=Nc.b;j.bindBuffer(j.ARRAY_BUFFER,Hb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Rc,Lc)}if(Cd){for(Ec=0;Ec<Ad;Ec++)Oc=pd[Ec],za=3*Ec,Sc[za]=Oc.x,Sc[za+1]=Oc.y,Sc[za+2]=Oc.z;j.bindBuffer(j.ARRAY_BUFFER,Hb.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Sc,Lc)}if(hd){Pc=
|
|
|
+0;for(md=hd.length;Pc<md;Pc++)if(Ga=hd[Pc],Ga.needsUpdate&&(void 0===Ga.boundTo||"vertices"===Ga.boundTo)){za=0;yc=Ga.value.length;if(1===Ga.size)for(lb=0;lb<yc;lb++)Ga.array[lb]=Ga.value[lb];else if(2===Ga.size)for(lb=0;lb<yc;lb++)vb=Ga.value[lb],Ga.array[za]=vb.x,Ga.array[za+1]=vb.y,za+=2;else if(3===Ga.size)if("c"===Ga.type)for(lb=0;lb<yc;lb++)vb=Ga.value[lb],Ga.array[za]=vb.r,Ga.array[za+1]=vb.g,Ga.array[za+2]=vb.b,za+=3;else for(lb=0;lb<yc;lb++)vb=Ga.value[lb],Ga.array[za]=vb.x,Ga.array[za+1]=
|
|
|
+vb.y,Ga.array[za+2]=vb.z,za+=3;else if(4===Ga.size)for(lb=0;lb<yc;lb++)vb=Ga.value[lb],Ga.array[za]=vb.x,Ga.array[za+1]=vb.y,Ga.array[za+2]=vb.z,Ga.array[za+3]=vb.w,za+=4;j.bindBuffer(j.ARRAY_BUFFER,Ga.buffer);j.bufferData(j.ARRAY_BUFFER,Ga.array,Lc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.normalsNeedUpdate=!1;ga.attributes&&x(ga)}else if(ha instanceof THREE.Line)if(N instanceof THREE.BufferGeometry)(N.verticesNeedUpdate||N.colorsNeedUpdate)&&h(N,j.DYNAMIC_DRAW,!N.dynamic),N.verticesNeedUpdate=
|
|
|
+!1,N.colorsNeedUpdate=!1;else{ga=e(ha,N);pa=ga.attributes&&t(ga);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.lineDistancesNeedUpdate||pa){var Ib=N,Tc=j.DYNAMIC_DRAW,Fc=void 0,Gc=void 0,Hc=void 0,Uc=void 0,Na=void 0,Vc=void 0,qd=Ib.vertices,rd=Ib.colors,sd=Ib.lineDistances,Dd=qd.length,Ed=rd.length,Fd=sd.length,Wc=Ib.__vertexArray,Xc=Ib.__colorArray,td=Ib.__lineDistanceArray,Gd=Ib.colorsNeedUpdate,Hd=Ib.lineDistancesNeedUpdate,id=Ib.__webglCustomAttributesList,Yc=void 0,ud=void 0,mb=void 0,zc=void 0,
|
|
|
+wb=void 0,Ha=void 0;if(Ib.verticesNeedUpdate){for(Fc=0;Fc<Dd;Fc++)Uc=qd[Fc],Na=3*Fc,Wc[Na]=Uc.x,Wc[Na+1]=Uc.y,Wc[Na+2]=Uc.z;j.bindBuffer(j.ARRAY_BUFFER,Ib.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Wc,Tc)}if(Gd){for(Gc=0;Gc<Ed;Gc++)Vc=rd[Gc],Na=3*Gc,Xc[Na]=Vc.r,Xc[Na+1]=Vc.g,Xc[Na+2]=Vc.b;j.bindBuffer(j.ARRAY_BUFFER,Ib.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Xc,Tc)}if(Hd){for(Hc=0;Hc<Fd;Hc++)td[Hc]=sd[Hc];j.bindBuffer(j.ARRAY_BUFFER,Ib.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,
|
|
|
+td,Tc)}if(id){Yc=0;for(ud=id.length;Yc<ud;Yc++)if(Ha=id[Yc],Ha.needsUpdate&&(void 0===Ha.boundTo||"vertices"===Ha.boundTo)){Na=0;zc=Ha.value.length;if(1===Ha.size)for(mb=0;mb<zc;mb++)Ha.array[mb]=Ha.value[mb];else if(2===Ha.size)for(mb=0;mb<zc;mb++)wb=Ha.value[mb],Ha.array[Na]=wb.x,Ha.array[Na+1]=wb.y,Na+=2;else if(3===Ha.size)if("c"===Ha.type)for(mb=0;mb<zc;mb++)wb=Ha.value[mb],Ha.array[Na]=wb.r,Ha.array[Na+1]=wb.g,Ha.array[Na+2]=wb.b,Na+=3;else for(mb=0;mb<zc;mb++)wb=Ha.value[mb],Ha.array[Na]=wb.x,
|
|
|
+Ha.array[Na+1]=wb.y,Ha.array[Na+2]=wb.z,Na+=3;else if(4===Ha.size)for(mb=0;mb<zc;mb++)wb=Ha.value[mb],Ha.array[Na]=wb.x,Ha.array[Na+1]=wb.y,Ha.array[Na+2]=wb.z,Ha.array[Na+3]=wb.w,Na+=4;j.bindBuffer(j.ARRAY_BUFFER,Ha.buffer);j.bufferData(j.ARRAY_BUFFER,Ha.array,Tc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.lineDistancesNeedUpdate=!1;ga.attributes&&x(ga)}else if(ha instanceof THREE.ParticleSystem)if(N instanceof THREE.BufferGeometry)(N.verticesNeedUpdate||N.colorsNeedUpdate)&&h(N,j.DYNAMIC_DRAW,
|
|
|
+!N.dynamic),N.verticesNeedUpdate=!1,N.colorsNeedUpdate=!1;else{ga=e(ha,N);pa=ga.attributes&&t(ga);if(N.verticesNeedUpdate||N.colorsNeedUpdate||ha.sortParticles||pa){var bc=N,jd=j.DYNAMIC_DRAW,Ic=ha,xb=void 0,cc=void 0,dc=void 0,ea=void 0,ec=void 0,qc=void 0,Zc=bc.vertices,kd=Zc.length,ld=bc.colors,vd=ld.length,vc=bc.__vertexArray,wc=bc.__colorArray,ic=bc.__sortArray,wd=bc.verticesNeedUpdate,xd=bc.colorsNeedUpdate,jc=bc.__webglCustomAttributesList,Jb=void 0,Ac=void 0,la=void 0,Kb=void 0,Ca=void 0,
|
|
|
+da=void 0;if(Ic.sortParticles){rc.copy(Ob);rc.multiply(Ic.matrixWorld);for(xb=0;xb<kd;xb++)dc=Zc[xb],ob.copy(dc),ob.applyMatrix4(rc),ic[xb]=[ob.z,xb];ic.sort(n);for(xb=0;xb<kd;xb++)dc=Zc[ic[xb][1]],ea=3*xb,vc[ea]=dc.x,vc[ea+1]=dc.y,vc[ea+2]=dc.z;for(cc=0;cc<vd;cc++)ea=3*cc,qc=ld[ic[cc][1]],wc[ea]=qc.r,wc[ea+1]=qc.g,wc[ea+2]=qc.b;if(jc){Jb=0;for(Ac=jc.length;Jb<Ac;Jb++)if(da=jc[Jb],void 0===da.boundTo||"vertices"===da.boundTo)if(ea=0,Kb=da.value.length,1===da.size)for(la=0;la<Kb;la++)ec=ic[la][1],
|
|
|
+da.array[la]=da.value[ec];else if(2===da.size)for(la=0;la<Kb;la++)ec=ic[la][1],Ca=da.value[ec],da.array[ea]=Ca.x,da.array[ea+1]=Ca.y,ea+=2;else if(3===da.size)if("c"===da.type)for(la=0;la<Kb;la++)ec=ic[la][1],Ca=da.value[ec],da.array[ea]=Ca.r,da.array[ea+1]=Ca.g,da.array[ea+2]=Ca.b,ea+=3;else for(la=0;la<Kb;la++)ec=ic[la][1],Ca=da.value[ec],da.array[ea]=Ca.x,da.array[ea+1]=Ca.y,da.array[ea+2]=Ca.z,ea+=3;else if(4===da.size)for(la=0;la<Kb;la++)ec=ic[la][1],Ca=da.value[ec],da.array[ea]=Ca.x,da.array[ea+
|
|
|
+1]=Ca.y,da.array[ea+2]=Ca.z,da.array[ea+3]=Ca.w,ea+=4}}else{if(wd)for(xb=0;xb<kd;xb++)dc=Zc[xb],ea=3*xb,vc[ea]=dc.x,vc[ea+1]=dc.y,vc[ea+2]=dc.z;if(xd)for(cc=0;cc<vd;cc++)qc=ld[cc],ea=3*cc,wc[ea]=qc.r,wc[ea+1]=qc.g,wc[ea+2]=qc.b;if(jc){Jb=0;for(Ac=jc.length;Jb<Ac;Jb++)if(da=jc[Jb],da.needsUpdate&&(void 0===da.boundTo||"vertices"===da.boundTo))if(Kb=da.value.length,ea=0,1===da.size)for(la=0;la<Kb;la++)da.array[la]=da.value[la];else if(2===da.size)for(la=0;la<Kb;la++)Ca=da.value[la],da.array[ea]=Ca.x,
|
|
|
+da.array[ea+1]=Ca.y,ea+=2;else if(3===da.size)if("c"===da.type)for(la=0;la<Kb;la++)Ca=da.value[la],da.array[ea]=Ca.r,da.array[ea+1]=Ca.g,da.array[ea+2]=Ca.b,ea+=3;else for(la=0;la<Kb;la++)Ca=da.value[la],da.array[ea]=Ca.x,da.array[ea+1]=Ca.y,da.array[ea+2]=Ca.z,ea+=3;else if(4===da.size)for(la=0;la<Kb;la++)Ca=da.value[la],da.array[ea]=Ca.x,da.array[ea+1]=Ca.y,da.array[ea+2]=Ca.z,da.array[ea+3]=Ca.w,ea+=4}}if(wd||Ic.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,bc.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
|
+vc,jd);if(xd||Ic.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,bc.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,wc,jd);if(jc){Jb=0;for(Ac=jc.length;Jb<Ac;Jb++)if(da=jc[Jb],da.needsUpdate||Ic.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,da.buffer),j.bufferData(j.ARRAY_BUFFER,da.array,jd)}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;ga.attributes&&x(ga)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Wa);var i,k,n,l,m;a instanceof THREE.MeshDepthMaterial?m="depth":a instanceof
|
|
|
+THREE.MeshNormalMaterial?m="normal":a instanceof THREE.MeshBasicMaterial?m="basic":a instanceof THREE.MeshLambertMaterial?m="lambert":a instanceof THREE.MeshPhongMaterial?m="phong":a instanceof THREE.LineBasicMaterial?m="basic":a instanceof THREE.LineDashedMaterial?m="dashed":a instanceof THREE.ParticleBasicMaterial&&(m="particle_basic");if(m){var p=THREE.ShaderLib[m];a.uniforms=THREE.UniformsUtils.clone(p.uniforms);a.vertexShader=p.vertexShader;a.fragmentShader=p.fragmentShader}var q,s,r;e=g=s=r=
|
|
|
+p=0;for(f=b.length;e<f;e++)q=b[e],q.onlyShadow||(q instanceof THREE.DirectionalLight&&g++,q instanceof THREE.PointLight&&s++,q instanceof THREE.SpotLight&&r++,q instanceof THREE.HemisphereLight&&p++);e=g;f=s;g=r;h=p;p=q=0;for(r=b.length;p<r;p++)s=b[p],s.castShadow&&(s instanceof THREE.SpotLight&&q++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&q++);l=q;cb&&d&&d.useVertexTexture?n=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&
|
|
|
+(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),n=b);a:{s=a.fragmentShader;r=a.vertexShader;p=a.uniforms;b=a.attributes;q=a.defines;var c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,
|
|
|
+skinning:a.skinning,maxBones:n,useVertexTexture:cb&&d&&d.useVertexTexture,boneTextureWidth:d&&d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:l,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,
|
|
|
+alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},t,x,w,d=[];m?d.push(m):(d.push(s),d.push(r));for(x in q)d.push(x),d.push(q[x]);for(t in c)d.push(t),d.push(c[t]);m=d.join();t=0;for(x=fa.length;t<x;t++)if(d=fa[t],d.code===m){d.usedTimes++;k=d.program;break a}t="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?t="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(t="SHADOWMAP_TYPE_PCF_SOFT");
|
|
|
+x=[];for(w in q)d=q[w],!1!==d&&(d="#define "+w+" "+d,x.push(d));d=x.join("\n");w=j.createProgram();x=["precision "+U+" float;",d,jb?"#define VERTEX_TEXTURES":"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,
|
|
|
+"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.boneTextureWidth?"#define N_BONE_PIXEL_X "+c.boneTextureWidth.toFixed(1):"",c.boneTextureHeight?"#define N_BONE_PIXEL_Y "+c.boneTextureHeight.toFixed(1):
|
|
|
+"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
|
|
|
+t=["precision "+U+" float;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",d,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",
|
|
|
c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
|
|
|
"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");t=W("fragment",t+s);x=W("vertex",x+r);j.attachShader(w,x);j.attachShader(w,t);j.linkProgram(w);j.getProgramParameter(w,j.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(w,j.VALIDATE_STATUS)+", gl error ["+
|
|
|
j.getError()+"]");j.deleteShader(t);j.deleteShader(x);w.uniforms={};w.attributes={};var y;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(y in p)t.push(y);y=t;t=0;for(x=y.length;t<x;t++)p=y[t],w.uniforms[p]=j.getUniformLocation(w,p);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(y=0;y<c.maxMorphTargets;y++)t.push("morphTarget"+
|
|
|
-y);for(y=0;y<c.maxMorphNormals;y++)t.push("morphNormal"+y);for(k in b)t.push(k);k=t;y=0;for(b=k.length;y<b;y++)t=k[y],w.attributes[t]=j.getAttribLocation(w,t);w.id=Ea++;ja.push({program:w,code:m,usedTimes:1});M.info.memory.programs=ja.length;k=w}a.program=k;y=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=y[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)w=
|
|
|
-b+k,0<=y[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;Pa!==
|
|
|
-b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),Pa=b);ea!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),ea=a)};this.setDepthTest=function(a){tb!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),tb=a)};this.setDepthWrite=function(a){eb!==a&&(j.depthMask(a),eb=a)};this.setBlending=function(a,b,c,d){a!==ua&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),
|
|
|
-j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)),ua=a);if(a===THREE.CustomBlending){if(b!==sa&&(j.blendEquation(K(b)),sa=b),c!==lb||d!==Ja)j.blendFunc(K(c),K(d)),lb=c,Ja=d}else Ja=
|
|
|
-lb=sa=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",ib),a.__webglTexture=j.createTexture(),M.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===(c.width&c.width-1)&&0===(c.height&c.height-1),e=K(a.format),
|
|
|
+y);for(y=0;y<c.maxMorphNormals;y++)t.push("morphNormal"+y);for(k in b)t.push(k);k=t;y=0;for(b=k.length;y<b;y++)t=k[y],w.attributes[t]=j.getAttribLocation(w,t);w.id=Da++;fa.push({program:w,code:m,usedTimes:1});M.info.memory.programs=fa.length;k=w}a.program=k;y=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=y[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)w=
|
|
|
+b+k,0<=y[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;ia!==
|
|
|
+b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),ia=b);ra!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),ra=a)};this.setDepthTest=function(a){hb!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),hb=a)};this.setDepthWrite=function(a){Ea!==a&&(j.depthMask(a),Ea=a)};this.setBlending=function(a,b,c,d){a!==ga&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),
|
|
|
+j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)),ga=a);if(a===THREE.CustomBlending){if(b!==Z&&(j.blendEquation(K(b)),Z=b),c!==pa||d!==gb)j.blendFunc(K(c),K(d)),pa=c,gb=d}else gb=pa=
|
|
|
+Z=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Va),a.__webglTexture=j.createTexture(),M.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===(c.width&c.width-1)&&0===(c.height&c.height-1),e=K(a.format),
|
|
|
f=K(a.type);A(j.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,i=g.length;h<i;h++)c=g[h],j.texImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture){h=0;for(i=g.length;h<i;h++)c=g[h],j.compressedTexImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,c.data)}else if(0<g.length&&d){h=0;for(i=g.length;h<i;h++)c=g[h],j.texImage2D(j.TEXTURE_2D,
|
|
|
-h,e,e,f,c);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&j.generateMipmap(j.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else j.activeTexture(j.TEXTURE0+b),j.bindTexture(j.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",Ua);a.__webglTexture=
|
|
|
+h,e,e,f,c);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&j.generateMipmap(j.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else j.activeTexture(j.TEXTURE0+b),j.bindTexture(j.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",$a);a.__webglTexture=
|
|
|
j.createTexture();M.info.memory.textures++;var c=0===(a.width&a.width-1)&&0===(a.height&a.height-1),d=K(a.format),e=K(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];j.bindTexture(j.TEXTURE_CUBE_MAP,a.__webglTexture);A(j.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=j.createFramebuffer();a.__webglRenderbuffer[f]=j.createRenderbuffer();j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=j.TEXTURE_CUBE_MAP_POSITIVE_X+f;j.bindFramebuffer(j.FRAMEBUFFER,
|
|
|
a.__webglFramebuffer[f]);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,h,g.__webglTexture,0);X(a.__webglRenderbuffer[f],a)}c&&j.generateMipmap(j.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=j.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:j.createRenderbuffer(),j.bindTexture(j.TEXTURE_2D,a.__webglTexture),A(j.TEXTURE_2D,a,c),j.texImage2D(j.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=j.TEXTURE_2D,j.bindFramebuffer(j.FRAMEBUFFER,a.__webglFramebuffer),
|
|
|
j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a.__webglRenderbuffer):X(a.__webglRenderbuffer,a),c&&j.generateMipmap(j.TEXTURE_2D);b?j.bindTexture(j.TEXTURE_CUBE_MAP,null):j.bindTexture(j.TEXTURE_2D,null);j.bindRenderbuffer(j.RENDERBUFFER,
|
|
|
-null);j.bindFramebuffer(j.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Cb,a=Qa,d=Sa,e=Ka);b!==la&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(d,e,c,a),la=b);kc=c;Mb=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};THREE.WebGLRenderTarget=function(a,b,c){THREE.EventDispatcher.call(this);this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);
|
|
|
+null);j.bindFramebuffer(j.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Db,a=nb,d=na,e=Ya);b!==Ia&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(d,e,c,a),Ia=b);kc=c;Mb=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};THREE.WebGLRenderTarget=function(a,b,c){THREE.EventDispatcher.call(this);this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);
|
|
|
this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
|
|
|
THREE.WebGLRenderTarget.prototype.clone=function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;a.shareDepthFrom=this.shareDepthFrom;return a};
|
|
|
THREE.WebGLRenderTarget.prototype.dispose=function(){this.dispatchEvent({type:"dispose"})};THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.material=this.color=null;this.uvs=[[]];this.z=null};THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];
|
|
@@ -603,12 +603,12 @@ a){this.vertices.push(new THREE.Vector3(0,g,0));for(i=0;i<d;i++)s=k[0][i],q=k[0]
|
|
|
-1,0),z=new THREE.Vector3(0,-1,0),I=m[h][i+1].clone(),H=m[h][i].clone(),D=new THREE.Vector2(H.u,1),this.faces.push(new THREE.Face3(s,q,l,[t,x,z])),this.faceVertexUvs[0].push([I,H,D])}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.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
|
|
|
h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=s+2*m,
|
|
|
-g=0;g<h;g++){var i=Z*g,k=Z*(g+1),l=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,r=h,t=e,w=f,l=l+W,i=i+W,n=n+W,k=k+W;G.faces.push(new THREE.Face4(l,i,n,k,null,null,x));l=z.generateSideWallUV(G,a,p,b,l,i,n,k,q,r,t,w);G.faceVertexUvs[0].push(l)}}}function f(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=W;d+=W;e+=W;G.faces.push(new THREE.Face3(c,d,e,null,null,t));c=f?z.generateBottomUV(G,a,b,c,d,e):z.generateTopUV(G,a,b,c,d,e);G.faceVertexUvs[0].push(c)}var i=void 0!==b.amount?b.amount:
|
|
|
+g=0;g<h;g++){var i=aa*g,k=aa*(g+1),l=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,r=h,t=e,w=f,l=l+W,i=i+W,n=n+W,k=k+W;G.faces.push(new THREE.Face4(l,i,n,k,null,null,x));l=z.generateSideWallUV(G,a,p,b,l,i,n,k,q,r,t,w);G.faceVertexUvs[0].push(l)}}}function f(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=W;d+=W;e+=W;G.faces.push(new THREE.Face3(c,d,e,null,null,t));c=f?z.generateBottomUV(G,a,b,c,d,e):z.generateTopUV(G,a,b,c,d,e);G.faceVertexUvs[0].push(c)}var i=void 0!==b.amount?b.amount:
|
|
|
100,h=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:h-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,q=b.extrudePath,l,r=!1,t=b.material,x=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,I,H,D;q&&(l=q.getSpacedPoints(s),r=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(q,s,
|
|
|
-!1),I=new THREE.Vector3,H=new THREE.Vector3,D=new THREE.Vector3);p||(k=h=m=0);var y,E,F,G=this,W=this.vertices.length,n=a.extractPoints(n),A=n.shape,n=n.holes;if(q=!THREE.Shape.Utils.isClockWise(A)){A=A.reverse();E=0;for(F=n.length;E<F;E++)y=n[E],THREE.Shape.Utils.isClockWise(y)&&(n[E]=y.reverse());q=!1}var X=THREE.Shape.Utils.triangulateShape(A,n),q=A;E=0;for(F=n.length;E<F;E++)y=n[E],A=A.concat(y);var B,K,L,P,Z=A.length,na=X.length,pa=[],J=0,ha=q.length;B=ha-1;for(K=J+1;J<ha;J++,B++,K++)B===ha&&
|
|
|
-(B=0),K===ha&&(K=0),pa[J]=d(q[J],q[B],q[K]);var ra=[],fa,M=pa.concat();E=0;for(F=n.length;E<F;E++){y=n[E];fa=[];J=0;ha=y.length;B=ha-1;for(K=J+1;J<ha;J++,B++,K++)B===ha&&(B=0),K===ha&&(K=0),fa[J]=d(y[J],y[B],y[K]);ra.push(fa);M=M.concat(fa)}for(B=0;B<m;B++){y=B/m;L=h*(1-y);K=k*Math.sin(y*Math.PI/2);J=0;for(ha=q.length;J<ha;J++)P=c(q[J],pa[J],K),f(P.x,P.y,-L);E=0;for(F=n.length;E<F;E++){y=n[E];fa=ra[E];J=0;for(ha=y.length;J<ha;J++)P=c(y[J],fa[J],K),f(P.x,P.y,-L)}}K=k;for(J=0;J<Z;J++)P=p?c(A[J],M[J],
|
|
|
-K):A[J],r?(H.copy(w.normals[0]).multiplyScalar(P.x),I.copy(w.binormals[0]).multiplyScalar(P.y),D.copy(l[0]).add(H).add(I),f(D.x,D.y,D.z)):f(P.x,P.y,0);for(y=1;y<=s;y++)for(J=0;J<Z;J++)P=p?c(A[J],M[J],K):A[J],r?(H.copy(w.normals[y]).multiplyScalar(P.x),I.copy(w.binormals[y]).multiplyScalar(P.y),D.copy(l[y]).add(H).add(I),f(D.x,D.y,D.z)):f(P.x,P.y,i/s*y);for(B=m-1;0<=B;B--){y=B/m;L=h*(1-y);K=k*Math.sin(y*Math.PI/2);J=0;for(ha=q.length;J<ha;J++)P=c(q[J],pa[J],K),f(P.x,P.y,i+L);E=0;for(F=n.length;E<F;E++){y=
|
|
|
-n[E];fa=ra[E];J=0;for(ha=y.length;J<ha;J++)P=c(y[J],fa[J],K),r?f(P.x,P.y+l[s-1].y,l[s-1].x+L):f(P.x,P.y,i+L)}}if(p){h=0*Z;for(J=0;J<na;J++)i=X[J],g(i[2]+h,i[1]+h,i[0]+h,!0);h=Z*(s+2*m);for(J=0;J<na;J++)i=X[J],g(i[0]+h,i[1]+h,i[2]+h,!1)}else{for(J=0;J<na;J++)i=X[J],g(i[2],i[1],i[0],!0);for(J=0;J<na;J++)i=X[J],g(i[0]+Z*s,i[1]+Z*s,i[2]+Z*s,!1)}i=0;e(q,i);i+=q.length;E=0;for(F=n.length;E<F;E++)y=n[E],e(y,i),i+=y.length};
|
|
|
+!1),I=new THREE.Vector3,H=new THREE.Vector3,D=new THREE.Vector3);p||(k=h=m=0);var y,E,F,G=this,W=this.vertices.length,n=a.extractPoints(n),A=n.shape,n=n.holes;if(q=!THREE.Shape.Utils.isClockWise(A)){A=A.reverse();E=0;for(F=n.length;E<F;E++)y=n[E],THREE.Shape.Utils.isClockWise(y)&&(n[E]=y.reverse());q=!1}var X=THREE.Shape.Utils.triangulateShape(A,n),q=A;E=0;for(F=n.length;E<F;E++)y=n[E],A=A.concat(y);var B,K,L,U,aa=A.length,ba=X.length,xa=[],J=0,ha=q.length;B=ha-1;for(K=J+1;J<ha;J++,B++,K++)B===ha&&
|
|
|
+(B=0),K===ha&&(K=0),xa[J]=d(q[J],q[B],q[K]);var ua=[],Oa,M=xa.concat();E=0;for(F=n.length;E<F;E++){y=n[E];Oa=[];J=0;ha=y.length;B=ha-1;for(K=J+1;J<ha;J++,B++,K++)B===ha&&(B=0),K===ha&&(K=0),Oa[J]=d(y[J],y[B],y[K]);ua.push(Oa);M=M.concat(Oa)}for(B=0;B<m;B++){y=B/m;L=h*(1-y);K=k*Math.sin(y*Math.PI/2);J=0;for(ha=q.length;J<ha;J++)U=c(q[J],xa[J],K),f(U.x,U.y,-L);E=0;for(F=n.length;E<F;E++){y=n[E];Oa=ua[E];J=0;for(ha=y.length;J<ha;J++)U=c(y[J],Oa[J],K),f(U.x,U.y,-L)}}K=k;for(J=0;J<aa;J++)U=p?c(A[J],M[J],
|
|
|
+K):A[J],r?(H.copy(w.normals[0]).multiplyScalar(U.x),I.copy(w.binormals[0]).multiplyScalar(U.y),D.copy(l[0]).add(H).add(I),f(D.x,D.y,D.z)):f(U.x,U.y,0);for(y=1;y<=s;y++)for(J=0;J<aa;J++)U=p?c(A[J],M[J],K):A[J],r?(H.copy(w.normals[y]).multiplyScalar(U.x),I.copy(w.binormals[y]).multiplyScalar(U.y),D.copy(l[y]).add(H).add(I),f(D.x,D.y,D.z)):f(U.x,U.y,i/s*y);for(B=m-1;0<=B;B--){y=B/m;L=h*(1-y);K=k*Math.sin(y*Math.PI/2);J=0;for(ha=q.length;J<ha;J++)U=c(q[J],xa[J],K),f(U.x,U.y,i+L);E=0;for(F=n.length;E<
|
|
|
+F;E++){y=n[E];Oa=ua[E];J=0;for(ha=y.length;J<ha;J++)U=c(y[J],Oa[J],K),r?f(U.x,U.y+l[s-1].y,l[s-1].x+L):f(U.x,U.y,i+L)}}if(p){h=0*aa;for(J=0;J<ba;J++)i=X[J],g(i[2]+h,i[1]+h,i[0]+h,!0);h=aa*(s+2*m);for(J=0;J<ba;J++)i=X[J],g(i[0]+h,i[1]+h,i[2]+h,!1)}else{for(J=0;J<ba;J++)i=X[J],g(i[2],i[1],i[0],!0);for(J=0;J<ba;J++)i=X[J],g(i[0]+aa*s,i[1]+aa*s,i[2]+aa*s,!1)}i=0;e(q,i);i+=q.length;E=0;for(F=n.length;E<F;E++)y=n[E],e(y,i),i+=y.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,i){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,h=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[g].x,
|
|
|
m=a.vertices[g].y,g=a.vertices[g].z,p=a.vertices[i].x,n=a.vertices[i].y,a=a.vertices[i].z;return 0.01>Math.abs(c-h)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-g),new THREE.Vector2(p,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(h,1-f),new THREE.Vector2(m,1-g),new THREE.Vector2(n,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};
|