|
@@ -130,16 +130,16 @@ 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),
|
|
!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);
|
|
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<
|
|
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,C,y,E=[],F=0,G={objects:[],sprites:[],lights:[],elements:[]},W=new THREE.Vector3,A=new THREE.Vector4,X=new THREE.Matrix4,B=new THREE.Matrix4,K,L=new THREE.Matrix4,T=new THREE.Matrix3,Z=new THREE.Matrix3,sa=new THREE.Vector3,Na=new THREE.Frustum,J=new THREE.Vector4,ja=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);B.multiplyMatrices(b.projectionMatrix,
|
|
|
|
-b.matrixWorldInverse);return a.applyMatrix4(B)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);B.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyMatrix4(B)};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,ha){var ta=!1,oa,da,ra,$,la,ib,Ea,ma,wa,xa,ea,Va,ob;y=w=r=s=0;G.elements.length=
|
|
|
|
-0;g.updateMatrixWorld();void 0===i.parent&&i.updateMatrixWorld();X.copy(i.matrixWorldInverse.getInverse(i.matrixWorld));B.multiplyMatrices(i.projectionMatrix,X);Z.getInverse(X);Z.transpose();Na.setFromMatrix(B);f=0;G.objects.length=0;G.sprites.length=0;G.lights.length=0;var qb=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===
|
|
|
|
-Na.intersectsObject(f))e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(B),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(B),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(B),e.z=W.z),G.objects.push(e));
|
|
|
|
-qb(f)}}};qb(g);!0===p&&G.objects.sort(c);g=0;for(p=G.objects.length;g<p;g++)if(ma=G.objects[g].object,K=ma.matrixWorld,k=0,ma instanceof THREE.Mesh){wa=ma.geometry;ra=wa.vertices;xa=wa.faces;wa=wa.faceVertexUvs;T.getInverse(K);T.transpose();Va=ma.material instanceof THREE.MeshFaceMaterial;ob=!0===Va?ma.material:null;oa=0;for(da=ra.length;oa<da;oa++)h=b(),h.positionWorld.copy(ra[oa]),h.positionWorld.applyMatrix4(K),h.positionScreen.copy(h.positionWorld),h.positionScreen.applyMatrix4(B),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(oa=xa.length;ra<oa;ra++){da=xa[ra];var tb=!0===Va?ob.materials[da.materialIndex]:ma.material;if(void 0!==tb){ib=tb.side;if(da instanceof THREE.Face3)if($=m[da.a],la=m[da.b],Ea=m[da.c],!0===$.visible||!0===la.visible||!0===Ea.visible)if(ta=0>(Ea.positionScreen.x-
|
|
|
|
-$.positionScreen.x)*(la.positionScreen.y-$.positionScreen.y)-(Ea.positionScreen.y-$.positionScreen.y)*(la.positionScreen.x-$.positionScreen.x),ib===THREE.DoubleSide||ta===(ib===THREE.FrontSide))s===l?(ea=new THREE.RenderableFace3,q.push(ea),l++,s++,n=ea):n=q[s++],n.v1.copy($),n.v2.copy(la),n.v3.copy(Ea);else continue;else continue;else if(da instanceof THREE.Face4)if($=m[da.a],la=m[da.b],Ea=m[da.c],ea=m[da.d],!0===$.visible||!0===la.visible||!0===Ea.visible||!0===ea.visible)if(ta=0>(ea.positionScreen.x-
|
|
|
|
-$.positionScreen.x)*(la.positionScreen.y-$.positionScreen.y)-(ea.positionScreen.y-$.positionScreen.y)*(la.positionScreen.x-$.positionScreen.x)||0>(la.positionScreen.x-Ea.positionScreen.x)*(ea.positionScreen.y-Ea.positionScreen.y)-(la.positionScreen.y-Ea.positionScreen.y)*(ea.positionScreen.x-Ea.positionScreen.x),ib===THREE.DoubleSide||ta===(ib===THREE.FrontSide)){if(r===x){var rb=new THREE.RenderableFace4;t.push(rb);x++;r++;n=rb}else n=t[r++];n.v1.copy($);n.v2.copy(la);n.v3.copy(Ea);n.v4.copy(ea)}else continue;
|
|
|
|
-else continue;n.normalModel.copy(da.normal);!1===ta&&(ib===THREE.BackSide||ib===THREE.DoubleSide)&&n.normalModel.negate();n.normalModel.applyMatrix3(T);n.normalModel.normalize();n.normalModelView.copy(n.normalModel);n.normalModelView.applyMatrix3(Z);n.centroidModel.copy(da.centroid);n.centroidModel.applyMatrix4(K);Ea=da.vertexNormals;$=0;for(la=Ea.length;$<la;$++)ea=n.vertexNormalsModel[$],ea.copy(Ea[$]),!1===ta&&(ib===THREE.BackSide||ib===THREE.DoubleSide)&&ea.negate(),ea.applyMatrix3(T),ea.normalize(),
|
|
|
|
-rb=n.vertexNormalsModelView[$],rb.copy(ea),rb.applyMatrix3(Z);n.vertexNormalsLength=Ea.length;ib=0;for($=wa.length;ib<$;ib++)if(ea=wa[ib][ra],void 0!==ea){la=0;for(Ea=ea.length;la<Ea;la++)n.uvs[ib][la]=ea[la]}n.color=da.color;n.material=tb;sa.copy(n.centroidModel);sa.applyMatrix4(B);n.z=sa.z;G.elements.push(n)}}}else if(ma instanceof THREE.Line){L.multiplyMatrices(B,K);ra=ma.geometry.vertices;$=b();$.positionScreen.copy(ra[0]);$.positionScreen.applyMatrix4(L);xa=ma.type===THREE.LinePieces?2:1;oa=
|
|
|
|
|
|
+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,C,y,E=[],F=0,G={objects:[],sprites:[],lights:[],elements:[]},W=new THREE.Vector3,A=new THREE.Vector4,X=new THREE.Matrix4,B=new THREE.Matrix4,K,L=new THREE.Matrix4,T=new THREE.Matrix3,Z=new THREE.Matrix3,sa=new THREE.Vector3,La=new THREE.Frustum,J=new THREE.Vector4,ja=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);B.multiplyMatrices(b.projectionMatrix,
|
|
|
|
+b.matrixWorldInverse);return a.applyMatrix4(B)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);B.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyMatrix4(B)};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,ha){var ta=!1,oa,da,ra,$,la,jb,Ea,ma,wa,xa,ea,Ua,Bb;y=w=r=s=0;G.elements.length=
|
|
|
|
+0;g.updateMatrixWorld();void 0===i.parent&&i.updateMatrixWorld();X.copy(i.matrixWorldInverse.getInverse(i.matrixWorld));B.multiplyMatrices(i.projectionMatrix,X);Z.getInverse(X);Z.transpose();La.setFromMatrix(B);f=0;G.objects.length=0;G.sprites.length=0;G.lights.length=0;var qb=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===
|
|
|
|
+La.intersectsObject(f))e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(W.copy(f.matrixWorld.getPosition()),W.applyMatrix4(B),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(B),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(B),e.z=W.z),G.objects.push(e));
|
|
|
|
+qb(f)}}};qb(g);!0===p&&G.objects.sort(c);g=0;for(p=G.objects.length;g<p;g++)if(ma=G.objects[g].object,K=ma.matrixWorld,k=0,ma instanceof THREE.Mesh){wa=ma.geometry;ra=wa.vertices;xa=wa.faces;wa=wa.faceVertexUvs;T.getInverse(K);T.transpose();Ua=ma.material instanceof THREE.MeshFaceMaterial;Bb=!0===Ua?ma.material:null;oa=0;for(da=ra.length;oa<da;oa++)h=b(),h.positionWorld.copy(ra[oa]),h.positionWorld.applyMatrix4(K),h.positionScreen.copy(h.positionWorld),h.positionScreen.applyMatrix4(B),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(oa=xa.length;ra<oa;ra++){da=xa[ra];var Sa=!0===Ua?Bb.materials[da.materialIndex]:ma.material;if(void 0!==Sa){jb=Sa.side;if(da instanceof THREE.Face3)if($=m[da.a],la=m[da.b],Ea=m[da.c],!0===$.visible||!0===la.visible||!0===Ea.visible)if(ta=0>(Ea.positionScreen.x-
|
|
|
|
+$.positionScreen.x)*(la.positionScreen.y-$.positionScreen.y)-(Ea.positionScreen.y-$.positionScreen.y)*(la.positionScreen.x-$.positionScreen.x),jb===THREE.DoubleSide||ta===(jb===THREE.FrontSide))s===l?(ea=new THREE.RenderableFace3,q.push(ea),l++,s++,n=ea):n=q[s++],n.v1.copy($),n.v2.copy(la),n.v3.copy(Ea);else continue;else continue;else if(da instanceof THREE.Face4)if($=m[da.a],la=m[da.b],Ea=m[da.c],ea=m[da.d],!0===$.visible||!0===la.visible||!0===Ea.visible||!0===ea.visible)if(ta=0>(ea.positionScreen.x-
|
|
|
|
+$.positionScreen.x)*(la.positionScreen.y-$.positionScreen.y)-(ea.positionScreen.y-$.positionScreen.y)*(la.positionScreen.x-$.positionScreen.x)||0>(la.positionScreen.x-Ea.positionScreen.x)*(ea.positionScreen.y-Ea.positionScreen.y)-(la.positionScreen.y-Ea.positionScreen.y)*(ea.positionScreen.x-Ea.positionScreen.x),jb===THREE.DoubleSide||ta===(jb===THREE.FrontSide)){if(r===x){var rb=new THREE.RenderableFace4;t.push(rb);x++;r++;n=rb}else n=t[r++];n.v1.copy($);n.v2.copy(la);n.v3.copy(Ea);n.v4.copy(ea)}else continue;
|
|
|
|
+else continue;n.normalModel.copy(da.normal);!1===ta&&(jb===THREE.BackSide||jb===THREE.DoubleSide)&&n.normalModel.negate();n.normalModel.applyMatrix3(T);n.normalModel.normalize();n.normalModelView.copy(n.normalModel);n.normalModelView.applyMatrix3(Z);n.centroidModel.copy(da.centroid);n.centroidModel.applyMatrix4(K);Ea=da.vertexNormals;$=0;for(la=Ea.length;$<la;$++)ea=n.vertexNormalsModel[$],ea.copy(Ea[$]),!1===ta&&(jb===THREE.BackSide||jb===THREE.DoubleSide)&&ea.negate(),ea.applyMatrix3(T),ea.normalize(),
|
|
|
|
+rb=n.vertexNormalsModelView[$],rb.copy(ea),rb.applyMatrix3(Z);n.vertexNormalsLength=Ea.length;jb=0;for($=wa.length;jb<$;jb++)if(ea=wa[jb][ra],void 0!==ea){la=0;for(Ea=ea.length;la<Ea;la++)n.uvs[jb][la]=ea[la]}n.color=da.color;n.material=Sa;sa.copy(n.centroidModel);sa.applyMatrix4(B);n.z=sa.z;G.elements.push(n)}}}else if(ma instanceof THREE.Line){L.multiplyMatrices(B,K);ra=ma.geometry.vertices;$=b();$.positionScreen.copy(ra[0]);$.positionScreen.applyMatrix4(L);xa=ma.type===THREE.LinePieces?2:1;oa=
|
|
1;for(da=ra.length;oa<da;oa++)$=b(),$.positionScreen.copy(ra[oa]),$.positionScreen.applyMatrix4(L),0<(oa+1)%xa||(la=m[k-2],J.copy($.positionScreen),ja.copy(la.positionScreen),!0===d(J,ja)&&(J.multiplyScalar(1/J.w),ja.multiplyScalar(1/ja.w),w===H?(wa=new THREE.RenderableLine,I.push(wa),H++,w++,z=wa):z=I[w++],z.v1.positionScreen.copy(J),z.v2.positionScreen.copy(ja),z.z=Math.max(J.z,ja.z),z.material=ma.material,G.elements.push(z)))}g=0;for(p=G.sprites.length;g<p;g++)ma=G.sprites[g].object,K=ma.matrixWorld,
|
|
1;for(da=ra.length;oa<da;oa++)$=b(),$.positionScreen.copy(ra[oa]),$.positionScreen.applyMatrix4(L),0<(oa+1)%xa||(la=m[k-2],J.copy($.positionScreen),ja.copy(la.positionScreen),!0===d(J,ja)&&(J.multiplyScalar(1/J.w),ja.multiplyScalar(1/ja.w),w===H?(wa=new THREE.RenderableLine,I.push(wa),H++,w++,z=wa):z=I[w++],z.v1.positionScreen.copy(J),z.v2.positionScreen.copy(ja),z.z=Math.max(J.z,ja.z),z.material=ma.material,G.elements.push(z)))}g=0;for(p=G.sprites.length;g<p;g++)ma=G.sprites[g].object,K=ma.matrixWorld,
|
|
ma instanceof THREE.Particle&&(A.set(K.elements[12],K.elements[13],K.elements[14],1),A.applyMatrix4(B),A.z/=A.w,0<A.z&&1>A.z&&(y===F?(ta=new THREE.RenderableParticle,E.push(ta),F++,y++,C=ta):C=E[y++],C.object=ma,C.x=A.x/A.w,C.y=A.y/A.w,C.z=A.z,C.rotation=ma.rotation.z,C.scale.x=ma.scale.x*Math.abs(C.x-(A.x+i.projectionMatrix.elements[0])/(A.w+i.projectionMatrix.elements[12])),C.scale.y=ma.scale.y*Math.abs(C.y-(A.y+i.projectionMatrix.elements[5])/(A.w+i.projectionMatrix.elements[13])),C.material=ma.material,
|
|
ma instanceof THREE.Particle&&(A.set(K.elements[12],K.elements[13],K.elements[14],1),A.applyMatrix4(B),A.z/=A.w,0<A.z&&1>A.z&&(y===F?(ta=new THREE.RenderableParticle,E.push(ta),F++,y++,C=ta):C=E[y++],C.object=ma,C.x=A.x/A.w,C.y=A.y/A.w,C.z=A.z,C.rotation=ma.rotation.z,C.scale.x=ma.scale.x*Math.abs(C.x-(A.x+i.projectionMatrix.elements[0])/(A.w+i.projectionMatrix.elements[12])),C.scale.y=ma.scale.y*Math.abs(C.y-(A.y+i.projectionMatrix.elements[5])/(A.w+i.projectionMatrix.elements[13])),C.material=ma.material,
|
|
G.elements.push(C)));!0===ha&&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};
|
|
G.elements.push(C)));!0===ha&&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};
|
|
@@ -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]=
|
|
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,
|
|
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=
|
|
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){sa.x=d[3*a];sa.y=d[3*a+1];sa.z=d[3*a+2];Na.copy(sa);ja=h[a];T.copy(ja);T.sub(sa.multiplyScalar(sa.dot(ja))).normalize();Z.crossVectors(Na,ja);ia=Z.dot(k[a]);J=0>ia?-1:1;i[4*a]=T.x;i[4*a+1]=T.y;i[4*a+2]=T.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){sa.x=d[3*a];sa.y=d[3*a+1];sa.z=d[3*a+2];La.copy(sa);ja=h[a];T.copy(ja);T.sub(sa.multiplyScalar(sa.dot(ja))).normalize();Z.crossVectors(La,ja);ia=Z.dot(k[a]);J=0>ia?-1:1;i[4*a]=T.x;i[4*a+1]=T.y;i[4*a+2]=T.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]=
|
|
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,C,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],C=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=C-z,H-=w,w=y-w,y=1/(I*w-z*H),f.set((w*s-
|
|
new THREE.Vector3,k[g]=new THREE.Vector3;var m,p,n,s,q,l,r,t,x,z,w,I,H,C,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],C=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=C-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 T=new THREE.Vector3,Z=new THREE.Vector3,sa=new THREE.Vector3,Na=new THREE.Vector3,J,ja,ia;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 T=new THREE.Vector3,Z=new THREE.Vector3,sa=new THREE.Vector3,La=new THREE.Vector3,J,ja,ia;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.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=
|
|
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=
|
|
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.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.__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:
|
|
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,C=null,y=null,E,F,G,W,A=new THREE.RenderableVertex,X=new THREE.RenderableVertex,B,K,L,T,Z,sa,Na,J,ja,ia,Qa,M,ha=new THREE.Color,ta=new THREE.Color,oa=new THREE.Color,da=new THREE.Color,ra=new THREE.Color,$=new THREE.Color,la=new THREE.Color,ib=new THREE.Color,Ea={},ma={},wa,xa,ea,Va,ob,qb,tb,rb,jc,kc,Oa=new THREE.Box2,Fa=new THREE.Box2,Ra=new THREE.Box2,Cb=!1,Ua=new THREE.Color,Kb=new THREE.Color,
|
|
|
|
-Lb=new THREE.Color,jb=new THREE.Vector3,zb,Mb,rc,kb,ya,$a,lb=16;zb=document.createElement("canvas");zb.width=zb.height=2;Mb=zb.getContext("2d");Mb.fillStyle="rgba(0,0,0,1)";Mb.fillRect(0,0,2,2);rc=Mb.getImageData(0,0,2,2);kb=rc.data;ya=document.createElement("canvas");ya.width=ya.height=lb;$a=ya.getContext("2d");$a.translate(-lb/2,-lb/2);$a.scale(lb,lb);lb--;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";Oa.min.set(-s,-q);Oa.max.set(s,q);Fa.min.set(-s,-q);Fa.max.set(s,q);x=1;z=0;y=C=H=I=w=null};this.setClearColor=function(a,b){r.copy(a);t=void 0!==b?b:1;Fa.min.set(-s,
|
|
|
|
--q);Fa.max.set(s,q)};this.setClearColorHex=function(a,b){r.setHex(a);t=void 0!==b?b:1;Fa.min.set(-s,-q);Fa.max.set(s,q)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){l.setTransform(1,0,0,-1,s,q);!1===Fa.empty()&&(Fa.intersect(Oa),Fa.expandByScalar(2),1>t&&l.clearRect(Fa.min.x|0,Fa.min.y|0,Fa.max.x-Fa.min.x|0,Fa.max.y-Fa.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(Fa.min.x|0,Fa.min.y|
|
|
|
|
-0,Fa.max.x-Fa.min.x|0,Fa.max.y-Fa.min.y|0)),Fa.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];ib.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(ib.multiplyScalar(j)))}else f instanceof THREE.PointLight&&(g=f.matrixWorld.getPosition(),j=b.dot(jb.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(ib.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;T=d.positionScreen.y;Z=e.positionScreen.x;sa=e.positionScreen.y;r(B,K,L,T,Z,sa);(Y instanceof THREE.MeshLambertMaterial||Y instanceof THREE.MeshPhongMaterial)&&null===Y.map&&null===Y.map?($.copy(Y.color),la.copy(Y.emissive),Y.vertexColors===THREE.FaceColors&&$.multiply(h.color),!0===Cb?!1===Y.wireframe&&
|
|
|
|
-Y.shading==THREE.SmoothShading&&3==h.vertexNormalsLength?(ta.copy(Ua),oa.copy(Ua),da.copy(Ua),n(h.v1.positionWorld,h.vertexNormalsModel[0],ta),n(h.v2.positionWorld,h.vertexNormalsModel[1],oa),n(h.v3.positionWorld,h.vertexNormalsModel[2],da),ta.multiply($).add(la),oa.multiply($).add(la),da.multiply($).add(la),ra.addColors(oa,da).multiplyScalar(0.5),ea=eb(ta,oa,da,ra),I(B,K,L,T,Z,sa,0,0,1,0,0,1,ea)):(ha.copy(Ua),n(h.centroidModel,h.normalModel,ha),ha.multiply($).add(la),!0===Y.wireframe?x(ha,Y.wireframeLinewidth,
|
|
|
|
-Y.wireframeLinecap,Y.wireframeLinejoin):w(ha)):!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&&(Va=h.uvs[0],z(B,K,L,T,Z,sa,Va[g].x,Va[g].y,Va[j].x,Va[j].y,Va[i].x,Va[i].y,Y.map)):null!==Y.envMap?Y.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(jb.copy(h.vertexNormalsModelView[g]),
|
|
|
|
-ob=0.5*jb.x+0.5,qb=0.5*jb.y+0.5,jb.copy(h.vertexNormalsModelView[j]),tb=0.5*jb.x+0.5,rb=0.5*jb.y+0.5,jb.copy(h.vertexNormalsModelView[i]),jc=0.5*jb.x+0.5,kc=0.5*jb.y+0.5,z(B,K,L,T,Z,sa,ob,qb,tb,rb,jc,kc,Y.envMap)):(ha.copy(Y.color),Y.vertexColors===THREE.FaceColors&&ha.multiply(h.color),!0===Y.wireframe?x(ha,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(ha)):Y instanceof THREE.MeshDepthMaterial?(wa=m.near,xa=m.far,j=1-ab(a.positionScreen.z*a.positionScreen.w,wa,xa),ta.setRGB(j,j,
|
|
|
|
-j),j=1-ab(d.positionScreen.z*d.positionScreen.w,wa,xa),oa.setRGB(j,j,j),j=1-ab(e.positionScreen.z*e.positionScreen.w,wa,xa),da.setRGB(j,j,j),ra.addColors(oa,da).multiplyScalar(0.5),ea=eb(ta,oa,da,ra),I(B,K,L,T,Z,sa,0,0,1,0,0,1,ea)):Y instanceof THREE.MeshNormalMaterial&&(Y.shading==THREE.FlatShading?(d=h.normalModelView,ha.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),!0===Y.wireframe?x(ha,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(ha)):Y.shading==THREE.SmoothShading&&
|
|
|
|
-(d=h.vertexNormalsModelView[g],ta.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[j],oa.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[i],da.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),ra.addColors(oa,da).multiplyScalar(0.5),ea=eb(ta,oa,da,ra),I(B,K,L,T,Z,sa,0,0,1,0,0,1,ea)))}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);C!==c&&(C=l.lineCap=c);y!==e&&(y=l.lineJoin=e);d(a.getStyle());l.stroke();Ra.expandByScalar(2*b)}function w(a){e(a.getStyle());l.fill()}function z(a,b,c,d,f,g,j,h,i,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;Ea[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===Ea[n.id]?e("rgba(0,0,0,1)"):e(Ea[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,h=(1-h+q)*r,c=c-a,d=d-b,f=f-a,g=g-b,i=(i+p)*s-j,Y=(1-Y+q)*r-h,k=(k+p)*s-j,m=(1-m+q)*r-h,p=i*m-k*Y;0===p?(void 0===ma[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),ma[n.id]=
|
|
|
|
-b.getImageData(0,0,n.image.width,n.image.height).data),b=ma[n.id],j=4*(Math.floor(j)+Math.floor(h)*n.image.width),ha.setRGB(b[j]/255,b[j+1]/255,b[j+2]/255),w(ha)):(p=1/p,n=(m*c-Y*f)*p,Y=(m*d-Y*g)*p,c=(i*f-k*c)*p,d=(i*g-k*d)*p,a=a-n*j-c*h,j=b-Y*j-d*h,l.save(),l.transform(n,Y,c,d,a,j),l.fill(),l.restore())}}function I(a,b,c,d,e,f,g,j,h,i,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;h=h*m-g;i=i*p-j;Y=Y*m-g;k=k*p-j;p=1/(h*k-Y*i);m=(k*c-i*e)*p;i=(k*d-i*f)*p;c=(h*e-Y*c)*p;d=(h*
|
|
|
|
-f-Y*d)*p;a=a-m*g-c*j;b=b-i*g-d*j;l.save();l.transform(m,i,c,d,a,b);l.clip();l.drawImage(n,0,0);l.restore()}function eb(a,b,c,d){kb[0]=255*a.r|0;kb[1]=255*a.g|0;kb[2]=255*a.b|0;kb[4]=255*b.r|0;kb[5]=255*b.g|0;kb[6]=255*b.b|0;kb[8]=255*c.r|0;kb[9]=255*c.g|0;kb[10]=255*c.b|0;kb[12]=255*d.r|0;kb[13]=255*d.g|0;kb[14]=255*d.b|0;Mb.putImageData(rc,0,0);$a.drawImage(zb,0,0);return ya}function ab(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function ub(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){Ua.setRGB(0,0,0);Kb.setRGB(0,0,0);Lb.setRGB(0,0,0);for(var lb=0,dc=h.length;lb<dc;lb++){var U=h[lb],S=U.color;U instanceof
|
|
|
|
-THREE.AmbientLight?Ua.add(S):U instanceof THREE.DirectionalLight?Kb.add(S):U instanceof THREE.PointLight&&Lb.add(S)}}lb=0;for(dc=i.length;lb<dc;lb++){var ga=i[lb],U=ga.material;if(!(void 0===U||!1===U.visible)){Ra.makeEmpty();if(ga instanceof THREE.RenderableParticle){E=ga;E.x*=s;E.y*=q;var S=E,Wa=ga;b(U.opacity);c(U.blending);var pb=void 0,fb=void 0,Sa=void 0,Xa=void 0,Y=ga=void 0,ed=void 0;U instanceof THREE.ParticleBasicMaterial?null===U.map?(Sa=Wa.object.scale.x,Xa=Wa.object.scale.y,Sa*=Wa.scale.x*
|
|
|
|
-s,Xa*=Wa.scale.y*q,Ra.min.set(S.x-Sa,S.y-Xa),Ra.max.set(S.x+Sa,S.y+Xa),!1!==Oa.isIntersectionBox(Ra)&&(e(U.color.getStyle()),l.save(),l.translate(S.x,S.y),l.rotate(-Wa.rotation),l.scale(Sa,Xa),l.fillRect(-1,-1,2,2),l.restore())):(ga=U.map.image,Y=ga.width>>1,ed=ga.height>>1,Sa=Wa.scale.x*s,Xa=Wa.scale.y*q,pb=Sa*Y,fb=Xa*ed,Ra.min.set(S.x-pb,S.y-fb),Ra.max.set(S.x+pb,S.y+fb),!1!==Oa.isIntersectionBox(Ra)&&(l.save(),l.translate(S.x,S.y),l.rotate(-Wa.rotation),l.scale(Sa,-Xa),l.translate(-Y,-ed),l.drawImage(ga,
|
|
|
|
-0,0),l.restore())):U instanceof THREE.ParticleCanvasMaterial&&(pb=Wa.scale.x*s,fb=Wa.scale.y*q,Ra.min.set(S.x-pb,S.y-fb),Ra.max.set(S.x+pb,S.y+fb),!1!==Oa.isIntersectionBox(Ra)&&(d(U.color.getStyle()),e(U.color.getStyle()),l.save(),l.translate(S.x,S.y),l.rotate(-Wa.rotation),l.scale(pb,fb),U.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,Ra.setFromPoints([E.positionScreen,F.positionScreen]),
|
|
|
|
-!0===Oa.isIntersectionBox(Ra)&&(S=E,Wa=F,b(U.opacity),c(U.blending),l.beginPath(),l.moveTo(S.positionScreen.x,S.positionScreen.y),l.lineTo(Wa.positionScreen.x,Wa.positionScreen.y),U instanceof THREE.LineBasicMaterial&&(S=U.linewidth,H!==S&&(H=l.lineWidth=S),S=U.linecap,C!==S&&(C=l.lineCap=S),S=U.linejoin,y!==S&&(y=l.lineJoin=S),d(U.color.getStyle()),l.stroke(),Ra.expandByScalar(2*U.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===U.overdraw&&(ub(E.positionScreen,F.positionScreen),ub(F.positionScreen,G.positionScreen),ub(G.positionScreen,E.positionScreen));Ra.setFromPoints([E.positionScreen,F.positionScreen,G.positionScreen]);!0===Oa.isIntersectionBox(Ra)&&p(E,F,G,0,1,2,ga,U,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===U.overdraw&&(ub(E.positionScreen,F.positionScreen),ub(F.positionScreen,W.positionScreen),ub(W.positionScreen,E.positionScreen),ub(G.positionScreen,A.positionScreen),ub(G.positionScreen,X.positionScreen));Ra.setFromPoints([E.positionScreen,F.positionScreen,G.positionScreen,W.positionScreen]);!0===Oa.isIntersectionBox(Ra)&&(S=E,Wa=F,pb=G,fb=W,Sa=A,Xa=X,Y=a,f.info.render.vertices+=4,f.info.render.faces++,b(U.opacity),c(U.blending),void 0!==U.map&&null!==U.map||void 0!==U.envMap&&null!==U.envMap?
|
|
|
|
-(p(S,Wa,fb,0,1,3,ga,U,Y),p(Sa,pb,Xa,1,2,3,ga,U,Y)):(B=S.positionScreen.x,K=S.positionScreen.y,L=Wa.positionScreen.x,T=Wa.positionScreen.y,Z=pb.positionScreen.x,sa=pb.positionScreen.y,Na=fb.positionScreen.x,J=fb.positionScreen.y,ja=Sa.positionScreen.x,ia=Sa.positionScreen.y,Qa=Xa.positionScreen.x,M=Xa.positionScreen.y,U instanceof THREE.MeshLambertMaterial||U instanceof THREE.MeshPhongMaterial?($.copy(U.color),la.copy(U.emissive),U.vertexColors===THREE.FaceColors&&$.multiply(ga.color),!0===Cb?!1===
|
|
|
|
-U.wireframe&&U.shading==THREE.SmoothShading&&4==ga.vertexNormalsLength?(ta.copy(Ua),oa.copy(Ua),da.copy(Ua),ra.copy(Ua),n(ga.v1.positionWorld,ga.vertexNormalsModel[0],ta),n(ga.v2.positionWorld,ga.vertexNormalsModel[1],oa),n(ga.v4.positionWorld,ga.vertexNormalsModel[3],da),n(ga.v3.positionWorld,ga.vertexNormalsModel[2],ra),ta.multiply($).add(la),oa.multiply($).add(la),da.multiply($).add(la),ra.multiply($).add(la),ea=eb(ta,oa,da,ra),r(B,K,L,T,Na,J),I(B,K,L,T,Na,J,0,0,1,0,0,1,ea),r(ja,ia,Z,sa,Qa,M),
|
|
|
|
-I(ja,ia,Z,sa,Qa,M,1,0,1,1,0,1,ea)):(ha.copy(Ua),n(ga.centroidModel,ga.normalModel,ha),ha.multiply($).add(la),t(B,K,L,T,Z,sa,Na,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha)):(ha.addColors($,la),t(B,K,L,T,Z,sa,Na,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha))):U instanceof THREE.MeshBasicMaterial?(ha.copy(U.color),U.vertexColors===THREE.FaceColors&&ha.multiply(ga.color),t(B,K,L,T,Z,sa,Na,J),!0===U.wireframe?
|
|
|
|
-x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha)):U instanceof THREE.MeshNormalMaterial?(S=void 0,U.shading==THREE.FlatShading?(S=ga.normalModelView,ha.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),t(B,K,L,T,Z,sa,Na,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha)):U.shading==THREE.SmoothShading&&(S=ga.vertexNormalsModelView[0],ta.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),S=ga.vertexNormalsModelView[1],oa.setRGB(S.x,
|
|
|
|
-S.y,S.z).multiplyScalar(0.5).addScalar(0.5),S=ga.vertexNormalsModelView[3],da.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),S=ga.vertexNormalsModelView[2],ra.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),ea=eb(ta,oa,da,ra),r(B,K,L,T,Na,J),I(B,K,L,T,Na,J,0,0,1,0,0,1,ea),r(ja,ia,Z,sa,Qa,M),I(ja,ia,Z,sa,Qa,M,1,0,1,1,0,1,ea))):U instanceof THREE.MeshDepthMaterial&&(wa=m.near,xa=m.far,ta.r=ta.g=ta.b=1-ab(S.positionScreen.z*S.positionScreen.w,wa,xa),oa.r=oa.g=oa.b=1-ab(Wa.positionScreen.z*
|
|
|
|
-Wa.positionScreen.w,wa,xa),da.r=da.g=da.b=1-ab(fb.positionScreen.z*fb.positionScreen.w,wa,xa),ra.r=ra.g=ra.b=1-ab(pb.positionScreen.z*pb.positionScreen.w,wa,xa),ea=eb(ta,oa,da,ra),r(B,K,L,T,Na,J),I(B,K,L,T,Na,J,0,0,1,0,0,1,ea),r(ja,ia,Z,sa,Qa,M),I(ja,ia,Z,sa,Qa,M,1,0,1,1,0,1,ea))))}Fa.union(Ra)}}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,C=null,y=null,E,F,G,W,A=new THREE.RenderableVertex,X=new THREE.RenderableVertex,B,K,L,T,Z,sa,La,J,ja,ia,Pa,M,ha=new THREE.Color,ta=new THREE.Color,oa=new THREE.Color,da=new THREE.Color,ra=new THREE.Color,$=new THREE.Color,la=new THREE.Color,jb=new THREE.Color,Ea={},ma={},wa,xa,ea,Ua,Bb,qb,Sa,rb,jc,kc,eb=new THREE.Box2,Na=new THREE.Box2,Va=new THREE.Box2,Cb=!1,Ta=new THREE.Color,Kb=new THREE.Color,
|
|
|
|
+Lb=new THREE.Color,kb=new THREE.Vector3,yb,Mb,rc,lb,ya,$a,mb=16;yb=document.createElement("canvas");yb.width=yb.height=2;Mb=yb.getContext("2d");Mb.fillStyle="rgba(0,0,0,1)";Mb.fillRect(0,0,2,2);rc=Mb.getImageData(0,0,2,2);lb=rc.data;ya=document.createElement("canvas");ya.width=ya.height=mb;$a=ya.getContext("2d");$a.translate(-mb/2,-mb/2);$a.scale(mb,mb);mb--;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";eb.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=C=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(eb),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];jb.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(jb.multiplyScalar(j)))}else f instanceof THREE.PointLight&&(g=f.matrixWorld.getPosition(),j=b.dot(kb.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(jb.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;T=d.positionScreen.y;Z=e.positionScreen.x;sa=e.positionScreen.y;r(B,K,L,T,Z,sa);(Y instanceof THREE.MeshLambertMaterial||Y instanceof THREE.MeshPhongMaterial)&&null===Y.map&&null===Y.map?($.copy(Y.color),la.copy(Y.emissive),
|
|
|
|
+Y.vertexColors===THREE.FaceColors&&$.multiply(h.color),!0===Cb?!1===Y.wireframe&&Y.shading==THREE.SmoothShading&&3==h.vertexNormalsLength?(ta.copy(Ta),oa.copy(Ta),da.copy(Ta),n(h.v1.positionWorld,h.vertexNormalsModel[0],ta),n(h.v2.positionWorld,h.vertexNormalsModel[1],oa),n(h.v3.positionWorld,h.vertexNormalsModel[2],da),ta.multiply($).add(la),oa.multiply($).add(la),da.multiply($).add(la),ra.addColors(oa,da).multiplyScalar(0.5),ea=fb(ta,oa,da,ra),I(B,K,L,T,Z,sa,0,0,1,0,0,1,ea)):(ha.copy(Ta),n(h.centroidModel,
|
|
|
|
+h.normalModel,ha),ha.multiply($).add(la),!0===Y.wireframe?x(ha,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(ha)):!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&&(Ua=h.uvs[0],z(B,K,L,T,Z,sa,Ua[g].x,Ua[g].y,Ua[j].x,Ua[j].y,Ua[i].x,Ua[i].y,Y.map)):null!==Y.envMap?
|
|
|
|
+Y.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(kb.copy(h.vertexNormalsModelView[g]),Bb=0.5*kb.x+0.5,qb=0.5*kb.y+0.5,kb.copy(h.vertexNormalsModelView[j]),Sa=0.5*kb.x+0.5,rb=0.5*kb.y+0.5,kb.copy(h.vertexNormalsModelView[i]),jc=0.5*kb.x+0.5,kc=0.5*kb.y+0.5,z(B,K,L,T,Z,sa,Bb,qb,Sa,rb,jc,kc,Y.envMap)):(ha.copy(Y.color),Y.vertexColors===THREE.FaceColors&&ha.multiply(h.color),!0===Y.wireframe?x(ha,Y.wireframeLinewidth,Y.wireframeLinecap,Y.wireframeLinejoin):w(ha)):Y instanceof THREE.MeshDepthMaterial?
|
|
|
|
+(wa=m.near,xa=m.far,j=1-ab(a.positionScreen.z*a.positionScreen.w,wa,xa),ta.setRGB(j,j,j),j=1-ab(d.positionScreen.z*d.positionScreen.w,wa,xa),oa.setRGB(j,j,j),j=1-ab(e.positionScreen.z*e.positionScreen.w,wa,xa),da.setRGB(j,j,j),ra.addColors(oa,da).multiplyScalar(0.5),ea=fb(ta,oa,da,ra),I(B,K,L,T,Z,sa,0,0,1,0,0,1,ea)):Y instanceof THREE.MeshNormalMaterial&&(Y.shading==THREE.FlatShading?(d=h.normalModelView,ha.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),!0===Y.wireframe?x(ha,Y.wireframeLinewidth,
|
|
|
|
+Y.wireframeLinecap,Y.wireframeLinejoin):w(ha)):Y.shading==THREE.SmoothShading&&(d=h.vertexNormalsModelView[g],ta.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[j],oa.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),d=h.vertexNormalsModelView[i],da.setRGB(d.x,d.y,d.z).multiplyScalar(0.5).addScalar(0.5),ra.addColors(oa,da).multiplyScalar(0.5),ea=fb(ta,oa,da,ra),I(B,K,L,T,Z,sa,0,0,1,0,0,1,ea)))}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);C!==c&&(C=l.lineCap=c);y!==e&&(y=l.lineJoin=e);d(a.getStyle());l.stroke();Va.expandByScalar(2*b)}function w(a){e(a.getStyle());l.fill()}function z(a,b,c,d,f,g,j,h,i,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;Ea[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===Ea[n.id]?e("rgba(0,0,0,1)"):e(Ea[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,h=(1-h+q)*r,c=c-a,d=d-b,f=f-a,g=g-b,i=(i+p)*s-j,Y=(1-Y+q)*r-h,k=(k+p)*s-j,m=(1-m+q)*r-h,p=i*m-k*Y;0===p?(void 0===ma[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),ma[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=ma[n.id],j=4*(Math.floor(j)+Math.floor(h)*n.image.width),ha.setRGB(b[j]/255,b[j+1]/255,b[j+2]/255),w(ha)):(p=1/p,n=(m*c-Y*f)*p,Y=(m*d-Y*g)*p,c=(i*f-k*c)*p,d=(i*g-k*d)*p,a=a-n*j-c*h,j=b-Y*j-d*h,l.save(),l.transform(n,Y,c,d,a,j),l.fill(),l.restore())}}function I(a,b,c,d,e,f,g,j,h,i,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;h=h*m-g;i=i*p-
|
|
|
|
+j;Y=Y*m-g;k=k*p-j;p=1/(h*k-Y*i);m=(k*c-i*e)*p;i=(k*d-i*f)*p;c=(h*e-Y*c)*p;d=(h*f-Y*d)*p;a=a-m*g-c*j;b=b-i*g-d*j;l.save();l.transform(m,i,c,d,a,b);l.clip();l.drawImage(n,0,0);l.restore()}function fb(a,b,c,d){lb[0]=255*a.r|0;lb[1]=255*a.g|0;lb[2]=255*a.b|0;lb[4]=255*b.r|0;lb[5]=255*b.g|0;lb[6]=255*b.b|0;lb[8]=255*c.r|0;lb[9]=255*c.g|0;lb[10]=255*c.b|0;lb[12]=255*d.r|0;lb[13]=255*d.g|0;lb[14]=255*d.b|0;Mb.putImageData(rc,0,0);$a.drawImage(yb,0,0);return ya}function ab(a,b,c){a=(a-b)/(c-b);return a*a*
|
|
|
|
+(3-2*a)}function tb(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){Ta.setRGB(0,0,0);Kb.setRGB(0,0,0);
|
|
|
|
+Lb.setRGB(0,0,0);for(var mb=0,dc=h.length;mb<dc;mb++){var U=h[mb],S=U.color;U instanceof THREE.AmbientLight?Ta.add(S):U instanceof THREE.DirectionalLight?Kb.add(S):U instanceof THREE.PointLight&&Lb.add(S)}}mb=0;for(dc=i.length;mb<dc;mb++){var ga=i[mb],U=ga.material;if(!(void 0===U||!1===U.visible)){Va.makeEmpty();if(ga instanceof THREE.RenderableParticle){E=ga;E.x*=s;E.y*=q;var S=E,Wa=ga;b(U.opacity);c(U.blending);var pb=void 0,gb=void 0,Qa=void 0,Xa=void 0,Y=ga=void 0,ed=void 0;U instanceof THREE.ParticleBasicMaterial?
|
|
|
|
+null===U.map?(Qa=Wa.object.scale.x,Xa=Wa.object.scale.y,Qa*=Wa.scale.x*s,Xa*=Wa.scale.y*q,Va.min.set(S.x-Qa,S.y-Xa),Va.max.set(S.x+Qa,S.y+Xa),!1!==eb.isIntersectionBox(Va)&&(e(U.color.getStyle()),l.save(),l.translate(S.x,S.y),l.rotate(-Wa.rotation),l.scale(Qa,Xa),l.fillRect(-1,-1,2,2),l.restore())):(ga=U.map.image,Y=ga.width>>1,ed=ga.height>>1,Qa=Wa.scale.x*s,Xa=Wa.scale.y*q,pb=Qa*Y,gb=Xa*ed,Va.min.set(S.x-pb,S.y-gb),Va.max.set(S.x+pb,S.y+gb),!1!==eb.isIntersectionBox(Va)&&(l.save(),l.translate(S.x,
|
|
|
|
+S.y),l.rotate(-Wa.rotation),l.scale(Qa,-Xa),l.translate(-Y,-ed),l.drawImage(ga,0,0),l.restore())):U instanceof THREE.ParticleCanvasMaterial&&(pb=Wa.scale.x*s,gb=Wa.scale.y*q,Va.min.set(S.x-pb,S.y-gb),Va.max.set(S.x+pb,S.y+gb),!1!==eb.isIntersectionBox(Va)&&(d(U.color.getStyle()),e(U.color.getStyle()),l.save(),l.translate(S.x,S.y),l.rotate(-Wa.rotation),l.scale(pb,gb),U.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,Va.setFromPoints([E.positionScreen,F.positionScreen]),!0===eb.isIntersectionBox(Va)&&(S=E,Wa=F,b(U.opacity),c(U.blending),l.beginPath(),l.moveTo(S.positionScreen.x,S.positionScreen.y),l.lineTo(Wa.positionScreen.x,Wa.positionScreen.y),U instanceof THREE.LineBasicMaterial&&(S=U.linewidth,H!==S&&(H=l.lineWidth=S),S=U.linecap,C!==S&&(C=l.lineCap=S),S=U.linejoin,y!==S&&(y=l.lineJoin=S),d(U.color.getStyle()),l.stroke(),Va.expandByScalar(2*U.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===U.overdraw&&(tb(E.positionScreen,F.positionScreen),tb(F.positionScreen,G.positionScreen),tb(G.positionScreen,E.positionScreen));Va.setFromPoints([E.positionScreen,F.positionScreen,
|
|
|
|
+G.positionScreen]);p(E,F,G,0,1,2,ga,U,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===U.overdraw&&(tb(E.positionScreen,F.positionScreen),tb(F.positionScreen,W.positionScreen),tb(W.positionScreen,E.positionScreen),tb(G.positionScreen,A.positionScreen),tb(G.positionScreen,X.positionScreen));Va.setFromPoints([E.positionScreen,F.positionScreen,G.positionScreen,W.positionScreen]);S=E;Wa=F;pb=G;gb=W;Qa=A;Xa=X;Y=a;f.info.render.vertices+=4;f.info.render.faces++;b(U.opacity);c(U.blending);void 0!==U.map&&
|
|
|
|
+null!==U.map||void 0!==U.envMap&&null!==U.envMap?(p(S,Wa,gb,0,1,3,ga,U,Y),p(Qa,pb,Xa,1,2,3,ga,U,Y)):(B=S.positionScreen.x,K=S.positionScreen.y,L=Wa.positionScreen.x,T=Wa.positionScreen.y,Z=pb.positionScreen.x,sa=pb.positionScreen.y,La=gb.positionScreen.x,J=gb.positionScreen.y,ja=Qa.positionScreen.x,ia=Qa.positionScreen.y,Pa=Xa.positionScreen.x,M=Xa.positionScreen.y,U instanceof THREE.MeshLambertMaterial||U instanceof THREE.MeshPhongMaterial?($.copy(U.color),la.copy(U.emissive),U.vertexColors===THREE.FaceColors&&
|
|
|
|
+$.multiply(ga.color),!0===Cb?!1===U.wireframe&&U.shading==THREE.SmoothShading&&4==ga.vertexNormalsLength?(ta.copy(Ta),oa.copy(Ta),da.copy(Ta),ra.copy(Ta),n(ga.v1.positionWorld,ga.vertexNormalsModel[0],ta),n(ga.v2.positionWorld,ga.vertexNormalsModel[1],oa),n(ga.v4.positionWorld,ga.vertexNormalsModel[3],da),n(ga.v3.positionWorld,ga.vertexNormalsModel[2],ra),ta.multiply($).add(la),oa.multiply($).add(la),da.multiply($).add(la),ra.multiply($).add(la),ea=fb(ta,oa,da,ra),r(B,K,L,T,La,J),I(B,K,L,T,La,J,0,
|
|
|
|
+0,1,0,0,1,ea),r(ja,ia,Z,sa,Pa,M),I(ja,ia,Z,sa,Pa,M,1,0,1,1,0,1,ea)):(ha.copy(Ta),n(ga.centroidModel,ga.normalModel,ha),ha.multiply($).add(la),t(B,K,L,T,Z,sa,La,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha)):(ha.addColors($,la),t(B,K,L,T,Z,sa,La,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha))):U instanceof THREE.MeshBasicMaterial?(ha.copy(U.color),U.vertexColors===THREE.FaceColors&&ha.multiply(ga.color),t(B,
|
|
|
|
+K,L,T,Z,sa,La,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha)):U instanceof THREE.MeshNormalMaterial?(S=void 0,U.shading==THREE.FlatShading?(S=ga.normalModelView,ha.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),t(B,K,L,T,Z,sa,La,J),!0===U.wireframe?x(ha,U.wireframeLinewidth,U.wireframeLinecap,U.wireframeLinejoin):w(ha)):U.shading==THREE.SmoothShading&&(S=ga.vertexNormalsModelView[0],ta.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),S=ga.vertexNormalsModelView[1],
|
|
|
|
+oa.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),S=ga.vertexNormalsModelView[3],da.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),S=ga.vertexNormalsModelView[2],ra.setRGB(S.x,S.y,S.z).multiplyScalar(0.5).addScalar(0.5),ea=fb(ta,oa,da,ra),r(B,K,L,T,La,J),I(B,K,L,T,La,J,0,0,1,0,0,1,ea),r(ja,ia,Z,sa,Pa,M),I(ja,ia,Z,sa,Pa,M,1,0,1,1,0,1,ea))):U instanceof THREE.MeshDepthMaterial&&(wa=m.near,xa=m.far,ta.r=ta.g=ta.b=1-ab(S.positionScreen.z*S.positionScreen.w,wa,xa),oa.r=oa.g=oa.b=1-ab(Wa.positionScreen.z*
|
|
|
|
+Wa.positionScreen.w,wa,xa),da.r=da.g=da.b=1-ab(gb.positionScreen.z*gb.positionScreen.w,wa,xa),ra.r=ra.g=ra.b=1-ab(pb.positionScreen.z*pb.positionScreen.w,wa,xa),ea=fb(ta,oa,da,ra),r(B,K,L,T,La,J),I(B,K,L,T,La,J,0,0,1,0,0,1,ea),r(ja,ia,Z,sa,Pa,M),I(ja,ia,Z,sa,Pa,M,1,0,1,1,0,1,ea)))}Na.union(Va)}}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_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
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",
|
|
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===
|
|
"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&&
|
|
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,
|
|
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){jb[a]||(j.enableVertexAttribArray(a),jb[a]=!0)}function m(){for(var a in jb)jb[a]&&(j.disableVertexAttribArray(a),jb[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++)la=
|
|
|
|
-oa=null,ra=$=wa=ma=tb=qb=xa=-1,$a=!0,a[d].render(b,c,Kb,Lb),la=oa=null,ra=$=wa=ma=tb=qb=xa=-1,$a=!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){kb[a]||(j.enableVertexAttribArray(a),kb[a]=!0)}function m(){for(var a in kb)kb[a]&&(j.disableVertexAttribArray(a),kb[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++)la=
|
|
|
|
+oa=null,ra=$=wa=ma=Sa=qb=xa=-1,$a=!0,a[d].render(b,c,Kb,Lb),la=oa=null,ra=$=wa=ma=Sa=qb=xa=-1,$a=!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})}
|
|
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){Ea=0;d.needsUpdate&&(d.program&&Xa(d),M.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));
|
|
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){Ea=0;d.needsUpdate&&(d.program&&Xa(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!==oa&&(j.useProgram(g),oa=g,f=!0);d.id!==ra&&(ra=d.id,f=!0);if(f||a!==la)j.uniformMatrix4fv(i.projectionMatrix,!1,a.projectionMatrix.elements),a!==la&&(la=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?
|
|
var f=!1,g=d.program,i=g.uniforms,h=d.uniforms;g!==oa&&(j.useProgram(g),oa=g,f=!0);d.id!==ra&&(ra=d.id,f=!0);if(f||a!==la)j.uniformMatrix4fv(i.projectionMatrix,!1,a.projectionMatrix.elements),a!==la&&(la=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($a){for(var n,m=k=0,l=0,p,q,s,r=lb,t=r.directional.colors,x=r.directional.positions,w=r.point.colors,z=r.point.positions,B=r.point.distances,C=r.spot.colors,F=r.spot.positions,G=r.spot.distances,I=r.spot.directions,J=r.spot.anglesCos,ha=r.spot.exponents,T=r.hemi.skyColors,U=r.hemi.groundColors,W=r.hemi.positions,
|
|
|
|
|
|
+(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($a){for(var n,m=k=0,l=0,p,q,s,r=mb,t=r.directional.colors,x=r.directional.positions,w=r.point.colors,z=r.point.positions,B=r.point.distances,C=r.spot.colors,F=r.spot.positions,G=r.spot.distances,I=r.spot.directions,J=r.spot.anglesCos,ha=r.spot.exponents,T=r.hemi.skyColors,U=r.hemi.groundColors,W=r.hemi.positions,
|
|
X=0,$=0,S=0,da=0,ta=0,ga=0,ea=0,ja=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?(ta+=1,n.visible&&(ya.copy(n.matrixWorld.getPosition()),ya.sub(n.target.matrixWorld.getPosition()),ya.normalize(),0===ya.x&&0===ya.y&&0===ya.z||(n=3*X,x[n]=ya.x,x[n+1]=ya.y,x[n+2]=ya.z,M.gammaInput?y(t,n,p,q*q):E(t,n,p,q),
|
|
X=0,$=0,S=0,da=0,ta=0,ga=0,ea=0,ja=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?(ta+=1,n.visible&&(ya.copy(n.matrixWorld.getPosition()),ya.sub(n.target.matrixWorld.getPosition()),ya.normalize(),0===ya.x&&0===ya.y&&0===ya.z||(n=3*X,x[n]=ya.x,x[n+1]=ya.y,x[n+2]=ya.z,M.gammaInput?y(t,n,p,q*q):E(t,n,p,q),
|
|
X+=1))):n instanceof THREE.PointLight?(ga+=1,n.visible&&(N=3*$,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,B[$]=s,$+=1)):n instanceof THREE.SpotLight?(ea+=1,n.visible&&(N=3*S,M.gammaInput?y(C,N,p,q*q):E(C,N,p,q),q=n.matrixWorld.getPosition(),F[N]=q.x,F[N+1]=q.y,F[N+2]=q.z,G[S]=s,ya.copy(q),ya.sub(n.target.matrixWorld.getPosition()),ya.normalize(),I[N]=ya.x,I[N+1]=ya.y,I[N+2]=ya.z,J[S]=Math.cos(n.angle),ha[S]=n.exponent,S+=1)):n instanceof THREE.HemisphereLight&&
|
|
X+=1))):n instanceof THREE.PointLight?(ga+=1,n.visible&&(N=3*$,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,B[$]=s,$+=1)):n instanceof THREE.SpotLight?(ea+=1,n.visible&&(N=3*S,M.gammaInput?y(C,N,p,q*q):E(C,N,p,q),q=n.matrixWorld.getPosition(),F[N]=q.x,F[N+1]=q.y,F[N+2]=q.z,G[S]=s,ya.copy(q),ya.sub(n.target.matrixWorld.getPosition()),ya.normalize(),I[N]=ya.x,I[N+1]=ya.y,I[N+2]=ya.z,J[S]=Math.cos(n.angle),ha[S]=n.exponent,S+=1)):n instanceof THREE.HemisphereLight&&
|
|
(ja+=1,n.visible&&(ya.copy(n.matrixWorld.getPosition()),ya.normalize(),0===ya.x&&0===ya.y&&0===ya.z||(s=3*da,W[s]=ya.x,W[s+1]=ya.y,W[s+2]=ya.z,p=n.color,n=n.groundColor,M.gammaInput?(q*=q,y(T,s,p,q),y(U,s,n,q)):(E(T,s,p,q),E(U,s,n,q)),da+=1))));c=3*X;for(f=Math.max(t.length,3*ta);c<f;c++)t[c]=0;c=3*$;for(f=Math.max(w.length,3*ga);c<f;c++)w[c]=0;c=3*S;for(f=Math.max(C.length,3*ea);c<f;c++)C[c]=0;c=3*da;for(f=Math.max(T.length,3*ja);c<f;c++)T[c]=0;c=3*da;for(f=Math.max(U.length,3*ja);c<f;c++)U[c]=0;
|
|
(ja+=1,n.visible&&(ya.copy(n.matrixWorld.getPosition()),ya.normalize(),0===ya.x&&0===ya.y&&0===ya.z||(s=3*da,W[s]=ya.x,W[s+1]=ya.y,W[s+2]=ya.z,p=n.color,n=n.groundColor,M.gammaInput?(q*=q,y(T,s,p,q),y(U,s,n,q)):(E(T,s,p,q),E(U,s,n,q)),da+=1))));c=3*X;for(f=Math.max(t.length,3*ta);c<f;c++)t[c]=0;c=3*$;for(f=Math.max(w.length,3*ga);c<f;c++)w[c]=0;c=3*S;for(f=Math.max(C.length,3*ea);c<f;c++)C[c]=0;c=3*da;for(f=Math.max(T.length,3*ja);c<f;c++)T[c]=0;c=3*da;for(f=Math.max(U.length,3*ja);c<f;c++)U[c]=0;
|
|
-r.directional.length=X;r.point.length=$;r.spot.length=S;r.hemi.length=da;r.ambient[0]=k;r.ambient[1]=m;r.ambient[2]=l;$a=!1}c=lb;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=
|
|
|
|
|
|
+r.directional.length=X;r.point.length=$;r.spot.length=S;r.hemi.length=da;r.ambient[0]=k;r.ambient[1]=m;r.ambient[2]=l;$a=!1}c=mb;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):
|
|
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?
|
|
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?
|
|
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?
|
|
@@ -369,22 +369,22 @@ 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.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===
|
|
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;
|
|
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"),T=void 0!==a.precision?a.precision:"highp",Z=void 0!==
|
|
|
|
-a.alpha?a.alpha:!0,sa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Na=void 0!==a.antialias?a.antialias:!1,J=void 0!==a.stencil?a.stencil:!0,ja=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ia=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),Qa=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!==zb){if(a===THREE.RGB_S3TC_DXT1_Format)return zb.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return zb.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return zb.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return zb.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"),T=void 0!==a.precision?a.precision:"highp",Z=void 0!==
|
|
|
|
+a.alpha?a.alpha:!0,sa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,La=void 0!==a.antialias?a.antialias:!1,J=void 0!==a.stencil?a.stencil:!0,ja=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ia=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),Pa=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,
|
|
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,ha=[],ta=0,oa=null,da=null,ra=-1,$=null,la=null,ib=0,Ea=0,ma=-1,wa=-1,xa=-1,ea=-1,Va=-1,ob=-1,qb=-1,tb=-1,rb=null,jc=null,kc=null,Oa=null,Fa=0,Ra=0,Cb=0,Ua=0,Kb=0,Lb=0,jb={},zb=new THREE.Frustum,Mb=new THREE.Matrix4,rc=new THREE.Matrix4,kb=new THREE.Vector3,ya=new THREE.Vector3,$a=!0,lb={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,Hb,Ab;try{if(!(j=L.getContext("experimental-webgl",{alpha:Z,premultipliedAlpha:sa,antialias:Na,stencil:J,preserveDrawingBuffer:ja})))throw"Error creating WebGL context.";}catch(cd){console.error(cd)}lc=j.getExtension("OES_texture_float");sc=j.getExtension("OES_standard_derivatives");Hb=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.");Hb||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(ia.r,ia.g,ia.b,Qa);this.context=j;var Cc=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),ad=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var bd=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Kc=Hb?j.getParameter(Hb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
|
|
|
|
-0,eb=0<ad,ab=eb&&lc;Ab&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var ub=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),dd=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var dc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),U=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 S=0<ub.precision&&0<dc.precision,ga=0<dd.precision&&0<U.precision;"highp"===T&&!S&&(ga?(T="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(T="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===
|
|
|
|
-T&&!ga&&(T="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return eb};this.supportsFloatTextures=function(){return lc};this.supportsStandardDerivatives=function(){return sc};this.supportsCompressedTextureS3TC=function(){return Ab};this.getMaxAnisotropy=function(){return Kc};this.getPrecision=function(){return T};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){Fa=void 0!==a?a:0;Ra=void 0!==b?b:0;Cb=void 0!==c?c:L.width;Ua=void 0!==d?d:L.height;j.viewport(Fa,Ra,Cb,Ua)};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){ia.setHex(a);Qa=b;j.clearColor(ia.r,ia.g,ia.b,Qa)};this.setClearColor=function(a,b){ia.copy(a);
|
|
|
|
-Qa=b;j.clearColor(ia.r,ia.g,ia.b,Qa)};this.getClearColor=function(){return ia};this.getClearAlpha=function(){return Qa};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){oa=null;ra=$=tb=qb=xa=-1;$a=!0;wa=ma=-1;this.shadowMapPlugin.update(a,b)};var Wa=function(a){a=a.target;a.removeEventListener("dispose",Wa);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&&
|
|
|
|
|
|
+geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,ha=[],ta=0,oa=null,da=null,ra=-1,$=null,la=null,jb=0,Ea=0,ma=-1,wa=-1,xa=-1,ea=-1,Ua=-1,Bb=-1,qb=-1,Sa=-1,rb=null,jc=null,kc=null,eb=null,Na=0,Va=0,Cb=0,Ta=0,Kb=0,Lb=0,kb={},yb=new THREE.Frustum,Mb=new THREE.Matrix4,rc=new THREE.Matrix4,lb=new THREE.Vector3,ya=new THREE.Vector3,$a=!0,mb={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,Hb,zb;try{if(!(j=L.getContext("experimental-webgl",{alpha:Z,premultipliedAlpha:sa,antialias:La,stencil:J,preserveDrawingBuffer:ja})))throw"Error creating WebGL context.";}catch(cd){console.error(cd)}lc=j.getExtension("OES_texture_float");sc=j.getExtension("OES_standard_derivatives");Hb=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||
|
|
|
|
+j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");zb=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.");Hb||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");zb||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(ia.r,ia.g,ia.b,Pa);this.context=j;var Cc=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),ad=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var bd=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Kc=Hb?j.getParameter(Hb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
|
|
|
|
+0,fb=0<ad,ab=fb&&lc;zb&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var tb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),dd=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var dc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),U=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 S=0<tb.precision&&0<dc.precision,ga=0<dd.precision&&0<U.precision;"highp"===T&&!S&&(ga?(T="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(T="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===
|
|
|
|
+T&&!ga&&(T="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return fb};this.supportsFloatTextures=function(){return lc};this.supportsStandardDerivatives=function(){return sc};this.supportsCompressedTextureS3TC=function(){return zb};this.getMaxAnisotropy=function(){return Kc};this.getPrecision=function(){return T};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;Va=void 0!==b?b:0;Cb=void 0!==c?c:L.width;Ta=void 0!==d?d:L.height;j.viewport(Na,Va,Cb,Ta)};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){ia.setHex(a);Pa=b;j.clearColor(ia.r,ia.g,ia.b,Pa)};this.setClearColor=function(a,b){ia.copy(a);
|
|
|
|
+Pa=b;j.clearColor(ia.r,ia.g,ia.b,Pa)};this.getClearColor=function(){return ia};this.getClearAlpha=function(){return Pa};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){oa=null;ra=$=Sa=qb=xa=-1;$a=!0;wa=ma=-1;this.shadowMapPlugin.update(a,b)};var Wa=function(a){a=a.target;a.removeEventListener("dispose",Wa);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=
|
|
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--},pb=function(a){a=a.target;a.removeEventListener("dispose",pb);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));
|
|
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--},pb=function(a){a=a.target;a.removeEventListener("dispose",pb);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));
|
|
-M.info.memory.textures--},fb=function(a){a=a.target;a.removeEventListener("dispose",fb);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--},Sa=function(a){a=a.target;a.removeEventListener("dispose",Sa);Xa(a)},Xa=function(a){var b=
|
|
|
|
|
|
+M.info.memory.textures--},gb=function(a){a=a.target;a.removeEventListener("dispose",gb);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--},Qa=function(a){a=a.target;a.removeEventListener("dispose",Qa);Xa(a)},Xa=function(a){var b=
|
|
a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=ha.length;a<c;a++)if(d=ha[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ha.length;a<c;a++)d=ha[a],d.program!==b&&e.push(d);ha=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.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=ha.length;a<c;a++)if(d=ha[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ha.length;a<c;a++)d=ha[a],d.program!==b&&e.push(d);ha=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<
|
|
(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),
|
|
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),
|
|
@@ -401,17 +401,17 @@ i.buffer),k(a.position),j.vertexAttribPointer(a.position,n,j.FLOAT,!1,0,0),n=e.a
|
|
(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,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,
|
|
(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.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!==Oa&&(j.lineWidth(d),Oa=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!==Oa&&(j.lineWidth(d),Oa=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;ra=-1;$a=!0;this.autoUpdateScene&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Mb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zb.setFromMatrix(Mb);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))){C(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:(kb.copy(g.matrixWorld.getPosition()),kb.applyMatrix4(Mb),f.z=kb.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&&(C(g,b),g=f.object.material,g.transparent?
|
|
|
|
|
|
+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!==eb&&(j.lineWidth(d),eb=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!==eb&&(j.lineWidth(d),eb=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;ra=-1;$a=!0;this.autoUpdateScene&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Mb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);yb.setFromMatrix(Mb);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||yb.intersectsObject(g))){C(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:(lb.copy(g.matrixWorld.getPosition()),lb.applyMatrix4(Mb),f.z=lb.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&&(C(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",
|
|
(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,
|
|
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);$=-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;
|
|
|
|
|
|
+null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=I(a,b,c,d,e);$=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,yb):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",Wa)),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,B=void 0,A=void 0,C=void 0,F=void 0,E=void 0,G={},H=s.morphTargets.length,I=s.morphNormals.length,K=p instanceof THREE.MeshFaceMaterial;s.geometryGroups=
|
|
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",Wa)),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,B=void 0,A=void 0,C=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(B=s.faces.length;y<B;y++)A=s.faces[y],C=K?A.materialIndex:0,void 0===G[C]&&(G[C]={hash:C,counter:0}),E=G[C].hash+"_"+G[C].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:C,vertices:0,numMorphTargets:H,numMorphNormals:I}),F=A instanceof THREE.Face3?3:4,65535<s.geometryGroups[E].vertices+F&&(G[C].counter+=1,E=G[C].hash+"_"+G[C].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:C,vertices:0,numMorphTargets:H,
|
|
{};y=0;for(B=s.faces.length;y<B;y++)A=s.faces[y],C=K?A.materialIndex:0,void 0===G[C]&&(G[C]={hash:C,counter:0}),E=G[C].hash+"_"+G[C].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:C,vertices:0,numMorphTargets:H,numMorphNormals:I}),F=A instanceof THREE.Face3?3:4,65535<s.geometryGroups[E].vertices+F&&(G[C].counter+=1,E=G[C].hash+"_"+G[C].counter,void 0===s.geometryGroups[E]&&(s.geometryGroups[E]={faces3:[],faces4:[],materialIndex:C,vertices:0,numMorphTargets:H,
|
|
-numMorphNormals:I})),A 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=ib++,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=
|
|
|
|
|
|
+numMorphNormals:I})),A 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=jb++,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 ha=void 0,T=void 0;if(J.numMorphTargets){J.__webglMorphTargetsBuffers=[];ha=0;for(T=J.numMorphTargets;ha<T;ha++)J.__webglMorphTargetsBuffers.push(j.createBuffer())}if(J.numMorphNormals){J.__webglMorphNormalsBuffers=[];ha=0;for(T=J.numMorphNormals;ha<
|
|
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 ha=void 0,T=void 0;if(J.numMorphTargets){J.__webglMorphTargetsBuffers=[];ha=0;for(T=J.numMorphTargets;ha<T;ha++)J.__webglMorphTargetsBuffers.push(j.createBuffer())}if(J.numMorphNormals){J.__webglMorphNormalsBuffers=[];ha=0;for(T=J.numMorphNormals;ha<
|
|
T;ha++)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();
|
|
T;ha++)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 S=l,X=b,$=S.vertices.length;S.__vertexArray=new Float32Array(3*$);S.__colorArray=new Float32Array(3*$);S.__normalArray=new Float32Array(3*$);S.__webglVertexCount=$;c(S,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 W=l;W.__webglVertexBuffer=j.createBuffer();W.__webglColorBuffer=j.createBuffer();W.__webglLineDistanceBuffer=j.createBuffer();
|
|
M.info.memory.geometries++;var S=l,X=b,$=S.vertices.length;S.__vertexArray=new Float32Array(3*$);S.__colorArray=new Float32Array(3*$);S.__normalArray=new Float32Array(3*$);S.__webglVertexCount=$;c(S,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 W=l;W.__webglVertexBuffer=j.createBuffer();W.__webglColorBuffer=j.createBuffer();W.__webglLineDistanceBuffer=j.createBuffer();
|
|
@@ -419,55 +419,55 @@ M.info.memory.geometries++;var da=l,oa=b,la=da.vertices.length;da.__vertexArray=
|
|
ta.__webglColorBuffer=j.createBuffer();M.info.memory.geometries++;var Z=l,ra=b,ga=Z.vertices.length;Z.__vertexArray=new Float32Array(3*ga);Z.__colorArray=new Float32Array(3*ga);Z.__sortArray=[];Z.__webglParticleCount=ga;c(Z,ra);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=
|
|
ta.__webglColorBuffer=j.createBuffer();M.info.memory.geometries++;var Z=l,ra=b,ga=Z.vertices.length;Z.__vertexArray=new Float32Array(3*ga);Z.__colorArray=new Float32Array(3*ga);Z.__sortArray=[];Z.__webglParticleCount=ga;c(Z,ra);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=
|
|
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],ja=a;ea instanceof THREE.Mesh||ea instanceof THREE.ParticleSystem||ea instanceof THREE.Ribbon||ea instanceof THREE.Line?z(ja.__webglObjects,ea):ea instanceof THREE.Sprite?w(ja.__webglSprites,ea):ea instanceof THREE.LensFlare?w(ja.__webglFlares,ea):(ea instanceof THREE.ImmediateRenderObject||ea.immediateRenderCallback)&&z(ja.__webglObjectsImmediate,ea);ea.__webglActive=!1;a.__objectsRemoved.splice(0,1)}for(var Ea=0,sa=a.__webglObjects.length;Ea<sa;Ea++){var ma=a.__webglObjects[Ea].object,
|
|
a.__objectsRemoved[0],ja=a;ea instanceof THREE.Mesh||ea instanceof THREE.ParticleSystem||ea instanceof THREE.Ribbon||ea instanceof THREE.Line?z(ja.__webglObjects,ea):ea instanceof THREE.Sprite?w(ja.__webglSprites,ea):ea instanceof THREE.LensFlare?w(ja.__webglFlares,ea):(ea instanceof THREE.ImmediateRenderObject||ea.immediateRenderCallback)&&z(ja.__webglObjectsImmediate,ea);ea.__webglActive=!1;a.__objectsRemoved.splice(0,1)}for(var Ea=0,sa=a.__webglObjects.length;Ea<sa;Ea++){var ma=a.__webglObjects[Ea].object,
|
|
-N=ma.geometry,ya=void 0,wa=void 0,ia=void 0;if(ma 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 Fa=0,Na=N.geometryGroupsList.length;Fa<Na;Fa++)if(ya=N.geometryGroupsList[Fa],ia=e(ma,
|
|
|
|
-ya),N.buffersNeedUpdate&&d(ya,ma),wa=ia.attributes&&t(ia),N.verticesNeedUpdate||N.morphTargetsNeedUpdate||N.elementsNeedUpdate||N.uvsNeedUpdate||N.normalsNeedUpdate||N.colorsNeedUpdate||N.tangentsNeedUpdate||wa){var qa=ya,Qa=ma,xa=j.DYNAMIC_DRAW,Ra=!N.dynamic,Va=ia;if(qa.__inittedArrays){var lb=f(Va),jb=Va.vertexColors?Va.vertexColors:!1,pb=g(Va),fb=lb===THREE.SmoothShading,D=void 0,V=void 0,Sa=void 0,O=void 0,Xa=void 0,Ua=void 0,Oa=void 0,tb=void 0,ob=void 0,qb=void 0,rb=void 0,P=void 0,Q=void 0,
|
|
|
|
-R=void 0,pa=void 0,$a=void 0,ab=void 0,eb=void 0,ub=void 0,Nb=void 0,Ob=void 0,Pb=void 0,zb=void 0,Qb=void 0,Rb=void 0,Sb=void 0,Ab=void 0,Tb=void 0,Ub=void 0,Vb=void 0,Cb=void 0,Wb=void 0,Xb=void 0,Yb=void 0,Hb=void 0,za=void 0,jc=void 0,mc=void 0,xc=void 0,yc=void 0,bb=void 0,kc=void 0,Ya=void 0,Za=void 0,nc=void 0,ec=void 0,Ma=0,Ta=0,fc=0,gc=0,Db=0,mb=0,Ca=0,sb=0,Pa=0,ba=0,ka=0,v=0,Aa=void 0,cb=qa.__vertexArray,Kb=qa.__uvArray,Lb=qa.__uv2Array,Eb=qa.__normalArray,Ia=qa.__tangentArray,db=qa.__colorArray,
|
|
|
|
-Ja=qa.__skinIndexArray,Ka=qa.__skinWeightArray,dc=qa.__morphTargetsArrays,lc=qa.__morphNormalsArrays,sc=qa.__webglCustomAttributesList,u=void 0,Zb=qa.__faceArray,Bb=qa.__lineArray,vb=Qa.geometry,Kc=vb.elementsNeedUpdate,Cc=vb.uvsNeedUpdate,ad=vb.normalsNeedUpdate,bd=vb.tangentsNeedUpdate,cd=vb.colorsNeedUpdate,dd=vb.morphTargetsNeedUpdate,tc=vb.vertices,ua=qa.faces3,va=qa.faces4,nb=vb.faces,fd=vb.faceVertexUvs[0],gd=vb.faceVertexUvs[1],uc=vb.skinIndices,oc=vb.skinWeights,pc=vb.morphTargets,Lc=vb.morphNormals;
|
|
|
|
-if(vb.verticesNeedUpdate){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],P=tc[O.a],Q=tc[O.b],R=tc[O.c],cb[Ta]=P.x,cb[Ta+1]=P.y,cb[Ta+2]=P.z,cb[Ta+3]=Q.x,cb[Ta+4]=Q.y,cb[Ta+5]=Q.z,cb[Ta+6]=R.x,cb[Ta+7]=R.y,cb[Ta+8]=R.z,Ta+=9;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],P=tc[O.a],Q=tc[O.b],R=tc[O.c],pa=tc[O.d],cb[Ta]=P.x,cb[Ta+1]=P.y,cb[Ta+2]=P.z,cb[Ta+3]=Q.x,cb[Ta+4]=Q.y,cb[Ta+5]=Q.z,cb[Ta+6]=R.x,cb[Ta+7]=R.y,cb[Ta+8]=R.z,cb[Ta+9]=pa.x,cb[Ta+10]=pa.y,cb[Ta+11]=pa.z,Ta+=12;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglVertexBuffer);
|
|
|
|
-j.bufferData(j.ARRAY_BUFFER,cb,xa)}if(dd){bb=0;for(kc=pc.length;bb<kc;bb++){D=ka=0;for(V=ua.length;D<V;D++)nc=ua[D],O=nb[nc],P=pc[bb].vertices[O.a],Q=pc[bb].vertices[O.b],R=pc[bb].vertices[O.c],Ya=dc[bb],Ya[ka]=P.x,Ya[ka+1]=P.y,Ya[ka+2]=P.z,Ya[ka+3]=Q.x,Ya[ka+4]=Q.y,Ya[ka+5]=Q.z,Ya[ka+6]=R.x,Ya[ka+7]=R.y,Ya[ka+8]=R.z,Va.morphNormals&&(fb?(ec=Lc[bb].vertexNormals[nc],Nb=ec.a,Ob=ec.b,Pb=ec.c):Pb=Ob=Nb=Lc[bb].faceNormals[nc],Za=lc[bb],Za[ka]=Nb.x,Za[ka+1]=Nb.y,Za[ka+2]=Nb.z,Za[ka+3]=Ob.x,Za[ka+4]=Ob.y,
|
|
|
|
-Za[ka+5]=Ob.z,Za[ka+6]=Pb.x,Za[ka+7]=Pb.y,Za[ka+8]=Pb.z),ka+=9;D=0;for(V=va.length;D<V;D++)nc=va[D],O=nb[nc],P=pc[bb].vertices[O.a],Q=pc[bb].vertices[O.b],R=pc[bb].vertices[O.c],pa=pc[bb].vertices[O.d],Ya=dc[bb],Ya[ka]=P.x,Ya[ka+1]=P.y,Ya[ka+2]=P.z,Ya[ka+3]=Q.x,Ya[ka+4]=Q.y,Ya[ka+5]=Q.z,Ya[ka+6]=R.x,Ya[ka+7]=R.y,Ya[ka+8]=R.z,Ya[ka+9]=pa.x,Ya[ka+10]=pa.y,Ya[ka+11]=pa.z,Va.morphNormals&&(fb?(ec=Lc[bb].vertexNormals[nc],Nb=ec.a,Ob=ec.b,Pb=ec.c,zb=ec.d):zb=Pb=Ob=Nb=Lc[bb].faceNormals[nc],Za=lc[bb],Za[ka]=
|
|
|
|
-Nb.x,Za[ka+1]=Nb.y,Za[ka+2]=Nb.z,Za[ka+3]=Ob.x,Za[ka+4]=Ob.y,Za[ka+5]=Ob.z,Za[ka+6]=Pb.x,Za[ka+7]=Pb.y,Za[ka+8]=Pb.z,Za[ka+9]=zb.x,Za[ka+10]=zb.y,Za[ka+11]=zb.z),ka+=12;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglMorphTargetsBuffers[bb]);j.bufferData(j.ARRAY_BUFFER,dc[bb],xa);Va.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglMorphNormalsBuffers[bb]),j.bufferData(j.ARRAY_BUFFER,lc[bb],xa))}}if(oc.length){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],Tb=oc[O.a],Ub=oc[O.b],Vb=oc[O.c],Ka[ba]=Tb.x,Ka[ba+1]=
|
|
|
|
-Tb.y,Ka[ba+2]=Tb.z,Ka[ba+3]=Tb.w,Ka[ba+4]=Ub.x,Ka[ba+5]=Ub.y,Ka[ba+6]=Ub.z,Ka[ba+7]=Ub.w,Ka[ba+8]=Vb.x,Ka[ba+9]=Vb.y,Ka[ba+10]=Vb.z,Ka[ba+11]=Vb.w,Wb=uc[O.a],Xb=uc[O.b],Yb=uc[O.c],Ja[ba]=Wb.x,Ja[ba+1]=Wb.y,Ja[ba+2]=Wb.z,Ja[ba+3]=Wb.w,Ja[ba+4]=Xb.x,Ja[ba+5]=Xb.y,Ja[ba+6]=Xb.z,Ja[ba+7]=Xb.w,Ja[ba+8]=Yb.x,Ja[ba+9]=Yb.y,Ja[ba+10]=Yb.z,Ja[ba+11]=Yb.w,ba+=12;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],Tb=oc[O.a],Ub=oc[O.b],Vb=oc[O.c],Cb=oc[O.d],Ka[ba]=Tb.x,Ka[ba+1]=Tb.y,Ka[ba+2]=Tb.z,Ka[ba+3]=Tb.w,Ka[ba+4]=
|
|
|
|
-Ub.x,Ka[ba+5]=Ub.y,Ka[ba+6]=Ub.z,Ka[ba+7]=Ub.w,Ka[ba+8]=Vb.x,Ka[ba+9]=Vb.y,Ka[ba+10]=Vb.z,Ka[ba+11]=Vb.w,Ka[ba+12]=Cb.x,Ka[ba+13]=Cb.y,Ka[ba+14]=Cb.z,Ka[ba+15]=Cb.w,Wb=uc[O.a],Xb=uc[O.b],Yb=uc[O.c],Hb=uc[O.d],Ja[ba]=Wb.x,Ja[ba+1]=Wb.y,Ja[ba+2]=Wb.z,Ja[ba+3]=Wb.w,Ja[ba+4]=Xb.x,Ja[ba+5]=Xb.y,Ja[ba+6]=Xb.z,Ja[ba+7]=Xb.w,Ja[ba+8]=Yb.x,Ja[ba+9]=Yb.y,Ja[ba+10]=Yb.z,Ja[ba+11]=Yb.w,Ja[ba+12]=Hb.x,Ja[ba+13]=Hb.y,Ja[ba+14]=Hb.z,Ja[ba+15]=Hb.w,ba+=16;0<ba&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglSkinIndicesBuffer),
|
|
|
|
-j.bufferData(j.ARRAY_BUFFER,Ja,xa),j.bindBuffer(j.ARRAY_BUFFER,qa.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Ka,xa))}if(cd&&jb){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],Oa=O.vertexColors,tb=O.color,3===Oa.length&&jb===THREE.VertexColors?(Qb=Oa[0],Rb=Oa[1],Sb=Oa[2]):Sb=Rb=Qb=tb,db[Pa]=Qb.r,db[Pa+1]=Qb.g,db[Pa+2]=Qb.b,db[Pa+3]=Rb.r,db[Pa+4]=Rb.g,db[Pa+5]=Rb.b,db[Pa+6]=Sb.r,db[Pa+7]=Sb.g,db[Pa+8]=Sb.b,Pa+=9;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],Oa=O.vertexColors,tb=O.color,4===Oa.length&&
|
|
|
|
-jb===THREE.VertexColors?(Qb=Oa[0],Rb=Oa[1],Sb=Oa[2],Ab=Oa[3]):Ab=Sb=Rb=Qb=tb,db[Pa]=Qb.r,db[Pa+1]=Qb.g,db[Pa+2]=Qb.b,db[Pa+3]=Rb.r,db[Pa+4]=Rb.g,db[Pa+5]=Rb.b,db[Pa+6]=Sb.r,db[Pa+7]=Sb.g,db[Pa+8]=Sb.b,db[Pa+9]=Ab.r,db[Pa+10]=Ab.g,db[Pa+11]=Ab.b,Pa+=12;0<Pa&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,db,xa))}if(bd&&vb.hasTangents){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],ob=O.vertexTangents,$a=ob[0],ab=ob[1],eb=ob[2],Ia[Ca]=$a.x,Ia[Ca+1]=$a.y,Ia[Ca+2]=$a.z,Ia[Ca+
|
|
|
|
-3]=$a.w,Ia[Ca+4]=ab.x,Ia[Ca+5]=ab.y,Ia[Ca+6]=ab.z,Ia[Ca+7]=ab.w,Ia[Ca+8]=eb.x,Ia[Ca+9]=eb.y,Ia[Ca+10]=eb.z,Ia[Ca+11]=eb.w,Ca+=12;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],ob=O.vertexTangents,$a=ob[0],ab=ob[1],eb=ob[2],ub=ob[3],Ia[Ca]=$a.x,Ia[Ca+1]=$a.y,Ia[Ca+2]=$a.z,Ia[Ca+3]=$a.w,Ia[Ca+4]=ab.x,Ia[Ca+5]=ab.y,Ia[Ca+6]=ab.z,Ia[Ca+7]=ab.w,Ia[Ca+8]=eb.x,Ia[Ca+9]=eb.y,Ia[Ca+10]=eb.z,Ia[Ca+11]=eb.w,Ia[Ca+12]=ub.x,Ia[Ca+13]=ub.y,Ia[Ca+14]=ub.z,Ia[Ca+15]=ub.w,Ca+=16;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglTangentBuffer);
|
|
|
|
-j.bufferData(j.ARRAY_BUFFER,Ia,xa)}if(ad&&lb){D=0;for(V=ua.length;D<V;D++)if(O=nb[ua[D]],Xa=O.vertexNormals,Ua=O.normal,3===Xa.length&&fb)for(za=0;3>za;za++)mc=Xa[za],Eb[mb]=mc.x,Eb[mb+1]=mc.y,Eb[mb+2]=mc.z,mb+=3;else for(za=0;3>za;za++)Eb[mb]=Ua.x,Eb[mb+1]=Ua.y,Eb[mb+2]=Ua.z,mb+=3;D=0;for(V=va.length;D<V;D++)if(O=nb[va[D]],Xa=O.vertexNormals,Ua=O.normal,4===Xa.length&&fb)for(za=0;4>za;za++)mc=Xa[za],Eb[mb]=mc.x,Eb[mb+1]=mc.y,Eb[mb+2]=mc.z,mb+=3;else for(za=0;4>za;za++)Eb[mb]=Ua.x,Eb[mb+1]=Ua.y,Eb[mb+
|
|
|
|
-2]=Ua.z,mb+=3;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Eb,xa)}if(Cc&&fd&&pb){D=0;for(V=ua.length;D<V;D++)if(Sa=ua[D],qb=fd[Sa],void 0!==qb)for(za=0;3>za;za++)xc=qb[za],Kb[fc]=xc.x,Kb[fc+1]=xc.y,fc+=2;D=0;for(V=va.length;D<V;D++)if(Sa=va[D],qb=fd[Sa],void 0!==qb)for(za=0;4>za;za++)xc=qb[za],Kb[fc]=xc.x,Kb[fc+1]=xc.y,fc+=2;0<fc&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,Kb,xa))}if(Cc&&gd&&pb){D=0;for(V=ua.length;D<V;D++)if(Sa=
|
|
|
|
-ua[D],rb=gd[Sa],void 0!==rb)for(za=0;3>za;za++)yc=rb[za],Lb[gc]=yc.x,Lb[gc+1]=yc.y,gc+=2;D=0;for(V=va.length;D<V;D++)if(Sa=va[D],rb=gd[Sa],void 0!==rb)for(za=0;4>za;za++)yc=rb[za],Lb[gc]=yc.x,Lb[gc+1]=yc.y,gc+=2;0<gc&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,Lb,xa))}if(Kc){D=0;for(V=ua.length;D<V;D++)Zb[Db]=Ma,Zb[Db+1]=Ma+1,Zb[Db+2]=Ma+2,Db+=3,Bb[sb]=Ma,Bb[sb+1]=Ma+1,Bb[sb+2]=Ma,Bb[sb+3]=Ma+2,Bb[sb+4]=Ma+1,Bb[sb+5]=Ma+2,sb+=6,Ma+=3;D=0;for(V=va.length;D<V;D++)Zb[Db]=
|
|
|
|
-Ma,Zb[Db+1]=Ma+1,Zb[Db+2]=Ma+3,Zb[Db+3]=Ma+1,Zb[Db+4]=Ma+2,Zb[Db+5]=Ma+3,Db+=6,Bb[sb]=Ma,Bb[sb+1]=Ma+1,Bb[sb+2]=Ma,Bb[sb+3]=Ma+3,Bb[sb+4]=Ma+1,Bb[sb+5]=Ma+2,Bb[sb+6]=Ma+2,Bb[sb+7]=Ma+3,sb+=8,Ma+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,qa.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Zb,xa);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,qa.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,xa)}if(sc){za=0;for(jc=sc.length;za<jc;za++)if(u=sc[za],u.__original.needsUpdate){v=0;if(1===u.size)if(void 0===
|
|
|
|
-u.boundTo||"vertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],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;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],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){D=0;for(V=ua.length;D<V;D++)Aa=u.value[ua[D]],u.array[v]=Aa,u.array[v+1]=Aa,u.array[v+2]=Aa,v+=3;D=0;for(V=va.length;D<V;D++)Aa=u.value[va[D]],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){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],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;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],pa=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+
|
|
|
|
|
|
+N=ma.geometry,ya=void 0,wa=void 0,ia=void 0;if(ma 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 La=0,Na=N.geometryGroupsList.length;La<Na;La++)if(ya=N.geometryGroupsList[La],ia=e(ma,
|
|
|
|
+ya),N.buffersNeedUpdate&&d(ya,ma),wa=ia.attributes&&t(ia),N.verticesNeedUpdate||N.morphTargetsNeedUpdate||N.elementsNeedUpdate||N.uvsNeedUpdate||N.normalsNeedUpdate||N.colorsNeedUpdate||N.tangentsNeedUpdate||wa){var qa=ya,Pa=ma,xa=j.DYNAMIC_DRAW,Va=!N.dynamic,Ua=ia;if(qa.__inittedArrays){var mb=f(Ua),kb=Ua.vertexColors?Ua.vertexColors:!1,pb=g(Ua),gb=mb===THREE.SmoothShading,D=void 0,V=void 0,Qa=void 0,O=void 0,Xa=void 0,Ta=void 0,Sa=void 0,Bb=void 0,eb=void 0,qb=void 0,rb=void 0,P=void 0,Q=void 0,
|
|
|
|
+R=void 0,pa=void 0,$a=void 0,ab=void 0,fb=void 0,tb=void 0,Nb=void 0,Ob=void 0,Pb=void 0,yb=void 0,Qb=void 0,Rb=void 0,Sb=void 0,zb=void 0,Tb=void 0,Ub=void 0,Vb=void 0,Cb=void 0,Wb=void 0,Xb=void 0,Yb=void 0,Hb=void 0,za=void 0,jc=void 0,mc=void 0,xc=void 0,yc=void 0,bb=void 0,kc=void 0,Ya=void 0,Za=void 0,nc=void 0,ec=void 0,Ma=0,Ra=0,fc=0,gc=0,Db=0,nb=0,Ca=0,sb=0,Oa=0,ba=0,ka=0,v=0,Aa=void 0,cb=qa.__vertexArray,Kb=qa.__uvArray,Lb=qa.__uv2Array,Eb=qa.__normalArray,Ha=qa.__tangentArray,db=qa.__colorArray,
|
|
|
|
+Ia=qa.__skinIndexArray,Ja=qa.__skinWeightArray,dc=qa.__morphTargetsArrays,lc=qa.__morphNormalsArrays,sc=qa.__webglCustomAttributesList,u=void 0,Zb=qa.__faceArray,Ab=qa.__lineArray,ub=Pa.geometry,Kc=ub.elementsNeedUpdate,Cc=ub.uvsNeedUpdate,ad=ub.normalsNeedUpdate,bd=ub.tangentsNeedUpdate,cd=ub.colorsNeedUpdate,dd=ub.morphTargetsNeedUpdate,tc=ub.vertices,ua=qa.faces3,va=qa.faces4,ob=ub.faces,fd=ub.faceVertexUvs[0],gd=ub.faceVertexUvs[1],uc=ub.skinIndices,oc=ub.skinWeights,pc=ub.morphTargets,Lc=ub.morphNormals;
|
|
|
|
+if(ub.verticesNeedUpdate){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],P=tc[O.a],Q=tc[O.b],R=tc[O.c],cb[Ra]=P.x,cb[Ra+1]=P.y,cb[Ra+2]=P.z,cb[Ra+3]=Q.x,cb[Ra+4]=Q.y,cb[Ra+5]=Q.z,cb[Ra+6]=R.x,cb[Ra+7]=R.y,cb[Ra+8]=R.z,Ra+=9;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],P=tc[O.a],Q=tc[O.b],R=tc[O.c],pa=tc[O.d],cb[Ra]=P.x,cb[Ra+1]=P.y,cb[Ra+2]=P.z,cb[Ra+3]=Q.x,cb[Ra+4]=Q.y,cb[Ra+5]=Q.z,cb[Ra+6]=R.x,cb[Ra+7]=R.y,cb[Ra+8]=R.z,cb[Ra+9]=pa.x,cb[Ra+10]=pa.y,cb[Ra+11]=pa.z,Ra+=12;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglVertexBuffer);
|
|
|
|
+j.bufferData(j.ARRAY_BUFFER,cb,xa)}if(dd){bb=0;for(kc=pc.length;bb<kc;bb++){D=ka=0;for(V=ua.length;D<V;D++)nc=ua[D],O=ob[nc],P=pc[bb].vertices[O.a],Q=pc[bb].vertices[O.b],R=pc[bb].vertices[O.c],Ya=dc[bb],Ya[ka]=P.x,Ya[ka+1]=P.y,Ya[ka+2]=P.z,Ya[ka+3]=Q.x,Ya[ka+4]=Q.y,Ya[ka+5]=Q.z,Ya[ka+6]=R.x,Ya[ka+7]=R.y,Ya[ka+8]=R.z,Ua.morphNormals&&(gb?(ec=Lc[bb].vertexNormals[nc],Nb=ec.a,Ob=ec.b,Pb=ec.c):Pb=Ob=Nb=Lc[bb].faceNormals[nc],Za=lc[bb],Za[ka]=Nb.x,Za[ka+1]=Nb.y,Za[ka+2]=Nb.z,Za[ka+3]=Ob.x,Za[ka+4]=Ob.y,
|
|
|
|
+Za[ka+5]=Ob.z,Za[ka+6]=Pb.x,Za[ka+7]=Pb.y,Za[ka+8]=Pb.z),ka+=9;D=0;for(V=va.length;D<V;D++)nc=va[D],O=ob[nc],P=pc[bb].vertices[O.a],Q=pc[bb].vertices[O.b],R=pc[bb].vertices[O.c],pa=pc[bb].vertices[O.d],Ya=dc[bb],Ya[ka]=P.x,Ya[ka+1]=P.y,Ya[ka+2]=P.z,Ya[ka+3]=Q.x,Ya[ka+4]=Q.y,Ya[ka+5]=Q.z,Ya[ka+6]=R.x,Ya[ka+7]=R.y,Ya[ka+8]=R.z,Ya[ka+9]=pa.x,Ya[ka+10]=pa.y,Ya[ka+11]=pa.z,Ua.morphNormals&&(gb?(ec=Lc[bb].vertexNormals[nc],Nb=ec.a,Ob=ec.b,Pb=ec.c,yb=ec.d):yb=Pb=Ob=Nb=Lc[bb].faceNormals[nc],Za=lc[bb],Za[ka]=
|
|
|
|
+Nb.x,Za[ka+1]=Nb.y,Za[ka+2]=Nb.z,Za[ka+3]=Ob.x,Za[ka+4]=Ob.y,Za[ka+5]=Ob.z,Za[ka+6]=Pb.x,Za[ka+7]=Pb.y,Za[ka+8]=Pb.z,Za[ka+9]=yb.x,Za[ka+10]=yb.y,Za[ka+11]=yb.z),ka+=12;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglMorphTargetsBuffers[bb]);j.bufferData(j.ARRAY_BUFFER,dc[bb],xa);Ua.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglMorphNormalsBuffers[bb]),j.bufferData(j.ARRAY_BUFFER,lc[bb],xa))}}if(oc.length){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],Tb=oc[O.a],Ub=oc[O.b],Vb=oc[O.c],Ja[ba]=Tb.x,Ja[ba+1]=
|
|
|
|
+Tb.y,Ja[ba+2]=Tb.z,Ja[ba+3]=Tb.w,Ja[ba+4]=Ub.x,Ja[ba+5]=Ub.y,Ja[ba+6]=Ub.z,Ja[ba+7]=Ub.w,Ja[ba+8]=Vb.x,Ja[ba+9]=Vb.y,Ja[ba+10]=Vb.z,Ja[ba+11]=Vb.w,Wb=uc[O.a],Xb=uc[O.b],Yb=uc[O.c],Ia[ba]=Wb.x,Ia[ba+1]=Wb.y,Ia[ba+2]=Wb.z,Ia[ba+3]=Wb.w,Ia[ba+4]=Xb.x,Ia[ba+5]=Xb.y,Ia[ba+6]=Xb.z,Ia[ba+7]=Xb.w,Ia[ba+8]=Yb.x,Ia[ba+9]=Yb.y,Ia[ba+10]=Yb.z,Ia[ba+11]=Yb.w,ba+=12;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],Tb=oc[O.a],Ub=oc[O.b],Vb=oc[O.c],Cb=oc[O.d],Ja[ba]=Tb.x,Ja[ba+1]=Tb.y,Ja[ba+2]=Tb.z,Ja[ba+3]=Tb.w,Ja[ba+4]=
|
|
|
|
+Ub.x,Ja[ba+5]=Ub.y,Ja[ba+6]=Ub.z,Ja[ba+7]=Ub.w,Ja[ba+8]=Vb.x,Ja[ba+9]=Vb.y,Ja[ba+10]=Vb.z,Ja[ba+11]=Vb.w,Ja[ba+12]=Cb.x,Ja[ba+13]=Cb.y,Ja[ba+14]=Cb.z,Ja[ba+15]=Cb.w,Wb=uc[O.a],Xb=uc[O.b],Yb=uc[O.c],Hb=uc[O.d],Ia[ba]=Wb.x,Ia[ba+1]=Wb.y,Ia[ba+2]=Wb.z,Ia[ba+3]=Wb.w,Ia[ba+4]=Xb.x,Ia[ba+5]=Xb.y,Ia[ba+6]=Xb.z,Ia[ba+7]=Xb.w,Ia[ba+8]=Yb.x,Ia[ba+9]=Yb.y,Ia[ba+10]=Yb.z,Ia[ba+11]=Yb.w,Ia[ba+12]=Hb.x,Ia[ba+13]=Hb.y,Ia[ba+14]=Hb.z,Ia[ba+15]=Hb.w,ba+=16;0<ba&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglSkinIndicesBuffer),
|
|
|
|
+j.bufferData(j.ARRAY_BUFFER,Ia,xa),j.bindBuffer(j.ARRAY_BUFFER,qa.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Ja,xa))}if(cd&&kb){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],Sa=O.vertexColors,Bb=O.color,3===Sa.length&&kb===THREE.VertexColors?(Qb=Sa[0],Rb=Sa[1],Sb=Sa[2]):Sb=Rb=Qb=Bb,db[Oa]=Qb.r,db[Oa+1]=Qb.g,db[Oa+2]=Qb.b,db[Oa+3]=Rb.r,db[Oa+4]=Rb.g,db[Oa+5]=Rb.b,db[Oa+6]=Sb.r,db[Oa+7]=Sb.g,db[Oa+8]=Sb.b,Oa+=9;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],Sa=O.vertexColors,Bb=O.color,4===Sa.length&&
|
|
|
|
+kb===THREE.VertexColors?(Qb=Sa[0],Rb=Sa[1],Sb=Sa[2],zb=Sa[3]):zb=Sb=Rb=Qb=Bb,db[Oa]=Qb.r,db[Oa+1]=Qb.g,db[Oa+2]=Qb.b,db[Oa+3]=Rb.r,db[Oa+4]=Rb.g,db[Oa+5]=Rb.b,db[Oa+6]=Sb.r,db[Oa+7]=Sb.g,db[Oa+8]=Sb.b,db[Oa+9]=zb.r,db[Oa+10]=zb.g,db[Oa+11]=zb.b,Oa+=12;0<Oa&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,db,xa))}if(bd&&ub.hasTangents){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],eb=O.vertexTangents,$a=eb[0],ab=eb[1],fb=eb[2],Ha[Ca]=$a.x,Ha[Ca+1]=$a.y,Ha[Ca+2]=$a.z,Ha[Ca+
|
|
|
|
+3]=$a.w,Ha[Ca+4]=ab.x,Ha[Ca+5]=ab.y,Ha[Ca+6]=ab.z,Ha[Ca+7]=ab.w,Ha[Ca+8]=fb.x,Ha[Ca+9]=fb.y,Ha[Ca+10]=fb.z,Ha[Ca+11]=fb.w,Ca+=12;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],eb=O.vertexTangents,$a=eb[0],ab=eb[1],fb=eb[2],tb=eb[3],Ha[Ca]=$a.x,Ha[Ca+1]=$a.y,Ha[Ca+2]=$a.z,Ha[Ca+3]=$a.w,Ha[Ca+4]=ab.x,Ha[Ca+5]=ab.y,Ha[Ca+6]=ab.z,Ha[Ca+7]=ab.w,Ha[Ca+8]=fb.x,Ha[Ca+9]=fb.y,Ha[Ca+10]=fb.z,Ha[Ca+11]=fb.w,Ha[Ca+12]=tb.x,Ha[Ca+13]=tb.y,Ha[Ca+14]=tb.z,Ha[Ca+15]=tb.w,Ca+=16;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglTangentBuffer);
|
|
|
|
+j.bufferData(j.ARRAY_BUFFER,Ha,xa)}if(ad&&mb){D=0;for(V=ua.length;D<V;D++)if(O=ob[ua[D]],Xa=O.vertexNormals,Ta=O.normal,3===Xa.length&&gb)for(za=0;3>za;za++)mc=Xa[za],Eb[nb]=mc.x,Eb[nb+1]=mc.y,Eb[nb+2]=mc.z,nb+=3;else for(za=0;3>za;za++)Eb[nb]=Ta.x,Eb[nb+1]=Ta.y,Eb[nb+2]=Ta.z,nb+=3;D=0;for(V=va.length;D<V;D++)if(O=ob[va[D]],Xa=O.vertexNormals,Ta=O.normal,4===Xa.length&&gb)for(za=0;4>za;za++)mc=Xa[za],Eb[nb]=mc.x,Eb[nb+1]=mc.y,Eb[nb+2]=mc.z,nb+=3;else for(za=0;4>za;za++)Eb[nb]=Ta.x,Eb[nb+1]=Ta.y,Eb[nb+
|
|
|
|
+2]=Ta.z,nb+=3;j.bindBuffer(j.ARRAY_BUFFER,qa.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Eb,xa)}if(Cc&&fd&&pb){D=0;for(V=ua.length;D<V;D++)if(Qa=ua[D],qb=fd[Qa],void 0!==qb)for(za=0;3>za;za++)xc=qb[za],Kb[fc]=xc.x,Kb[fc+1]=xc.y,fc+=2;D=0;for(V=va.length;D<V;D++)if(Qa=va[D],qb=fd[Qa],void 0!==qb)for(za=0;4>za;za++)xc=qb[za],Kb[fc]=xc.x,Kb[fc+1]=xc.y,fc+=2;0<fc&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,Kb,xa))}if(Cc&&gd&&pb){D=0;for(V=ua.length;D<V;D++)if(Qa=
|
|
|
|
+ua[D],rb=gd[Qa],void 0!==rb)for(za=0;3>za;za++)yc=rb[za],Lb[gc]=yc.x,Lb[gc+1]=yc.y,gc+=2;D=0;for(V=va.length;D<V;D++)if(Qa=va[D],rb=gd[Qa],void 0!==rb)for(za=0;4>za;za++)yc=rb[za],Lb[gc]=yc.x,Lb[gc+1]=yc.y,gc+=2;0<gc&&(j.bindBuffer(j.ARRAY_BUFFER,qa.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,Lb,xa))}if(Kc){D=0;for(V=ua.length;D<V;D++)Zb[Db]=Ma,Zb[Db+1]=Ma+1,Zb[Db+2]=Ma+2,Db+=3,Ab[sb]=Ma,Ab[sb+1]=Ma+1,Ab[sb+2]=Ma,Ab[sb+3]=Ma+2,Ab[sb+4]=Ma+1,Ab[sb+5]=Ma+2,sb+=6,Ma+=3;D=0;for(V=va.length;D<V;D++)Zb[Db]=
|
|
|
|
+Ma,Zb[Db+1]=Ma+1,Zb[Db+2]=Ma+3,Zb[Db+3]=Ma+1,Zb[Db+4]=Ma+2,Zb[Db+5]=Ma+3,Db+=6,Ab[sb]=Ma,Ab[sb+1]=Ma+1,Ab[sb+2]=Ma,Ab[sb+3]=Ma+3,Ab[sb+4]=Ma+1,Ab[sb+5]=Ma+2,Ab[sb+6]=Ma+2,Ab[sb+7]=Ma+3,sb+=8,Ma+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,qa.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Zb,xa);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,qa.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Ab,xa)}if(sc){za=0;for(jc=sc.length;za<jc;za++)if(u=sc[za],u.__original.needsUpdate){v=0;if(1===u.size)if(void 0===
|
|
|
|
+u.boundTo||"vertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],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;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],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){D=0;for(V=ua.length;D<V;D++)Aa=u.value[ua[D]],u.array[v]=Aa,u.array[v+1]=Aa,u.array[v+2]=Aa,v+=3;D=0;for(V=va.length;D<V;D++)Aa=u.value[va[D]],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){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],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;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],pa=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]=pa.x,u.array[v+7]=pa.y,v+=8}else{if("faces"===u.boundTo){D=0;for(V=ua.length;D<V;D++)R=Q=P=Aa=u.value[ua[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,v+=6;D=0;for(V=va.length;D<V;D++)pa=R=Q=P=Aa=u.value[va[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]=pa.x,u.array[v+7]=pa.y,v+=8}}else if(3===u.size){var aa;aa="c"===u.type?["r","g","b"]:["x","y","z"];if(void 0===u.boundTo||
|
|
6]=pa.x,u.array[v+7]=pa.y,v+=8}else{if("faces"===u.boundTo){D=0;for(V=ua.length;D<V;D++)R=Q=P=Aa=u.value[ua[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,v+=6;D=0;for(V=va.length;D<V;D++)pa=R=Q=P=Aa=u.value[va[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]=pa.x,u.array[v+7]=pa.y,v+=8}}else if(3===u.size){var aa;aa="c"===u.type?["r","g","b"]:["x","y","z"];if(void 0===u.boundTo||
|
|
-"vertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)O=nb[ua[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],v+=9;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],pa=u.value[O.d],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+
|
|
|
|
|
|
+"vertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)O=ob[ua[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],v+=9;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],pa=u.value[O.d],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+
|
|
4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],u.array[v+9]=pa[aa[0]],u.array[v+10]=pa[aa[1]],u.array[v+11]=pa[aa[2]],v+=12}else if("faces"===u.boundTo){D=0;for(V=ua.length;D<V;D++)R=Q=P=Aa=u.value[ua[D]],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],v+=9;D=0;for(V=va.length;D<V;D++)pa=R=Q=P=Aa=u.value[va[D]],
|
|
4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],u.array[v+9]=pa[aa[0]],u.array[v+10]=pa[aa[1]],u.array[v+11]=pa[aa[2]],v+=12}else if("faces"===u.boundTo){D=0;for(V=ua.length;D<V;D++)R=Q=P=Aa=u.value[ua[D]],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],v+=9;D=0;for(V=va.length;D<V;D++)pa=R=Q=P=Aa=u.value[va[D]],
|
|
u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],u.array[v+9]=pa[aa[0]],u.array[v+10]=pa[aa[1]],u.array[v+11]=pa[aa[2]],v+=12}else if("faceVertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)Aa=u.value[ua[D]],P=Aa[0],Q=Aa[1],R=Aa[2],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],
|
|
u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],u.array[v+9]=pa[aa[0]],u.array[v+10]=pa[aa[1]],u.array[v+11]=pa[aa[2]],v+=12}else if("faceVertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)Aa=u.value[ua[D]],P=Aa[0],Q=Aa[1],R=Aa[2],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],
|
|
u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],v+=9;D=0;for(V=va.length;D<V;D++)Aa=u.value[va[D]],P=Aa[0],Q=Aa[1],R=Aa[2],pa=Aa[3],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],u.array[v+9]=pa[aa[0]],u.array[v+10]=pa[aa[1]],u.array[v+11]=pa[aa[2]],v+=12}}else if(4===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){D=0;for(V=ua.length;D<
|
|
u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],v+=9;D=0;for(V=va.length;D<V;D++)Aa=u.value[va[D]],P=Aa[0],Q=Aa[1],R=Aa[2],pa=Aa[3],u.array[v]=P[aa[0]],u.array[v+1]=P[aa[1]],u.array[v+2]=P[aa[2]],u.array[v+3]=Q[aa[0]],u.array[v+4]=Q[aa[1]],u.array[v+5]=Q[aa[2]],u.array[v+6]=R[aa[0]],u.array[v+7]=R[aa[1]],u.array[v+8]=R[aa[2]],u.array[v+9]=pa[aa[0]],u.array[v+10]=pa[aa[1]],u.array[v+11]=pa[aa[2]],v+=12}}else if(4===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){D=0;for(V=ua.length;D<
|
|
-V;D++)O=nb[ua[D]],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;D=0;for(V=va.length;D<V;D++)O=nb[va[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],pa=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+
|
|
|
|
|
|
+V;D++)O=ob[ua[D]],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;D=0;for(V=va.length;D<V;D++)O=ob[va[D]],P=u.value[O.a],Q=u.value[O.b],R=u.value[O.c],pa=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]=pa.x,u.array[v+13]=pa.y,u.array[v+14]=pa.z,u.array[v+15]=pa.w,v+=16}else if("faces"===u.boundTo){D=0;for(V=ua.length;D<V;D++)R=Q=P=Aa=u.value[ua[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,v+=12;D=0;for(V=va.length;D<V;D++)pa=R=Q=P=Aa=u.value[va[D]],
|
|
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]=pa.x,u.array[v+13]=pa.y,u.array[v+14]=pa.z,u.array[v+15]=pa.w,v+=16}else if("faces"===u.boundTo){D=0;for(V=ua.length;D<V;D++)R=Q=P=Aa=u.value[ua[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,v+=12;D=0;for(V=va.length;D<V;D++)pa=R=Q=P=Aa=u.value[va[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]=pa.x,u.array[v+13]=pa.y,u.array[v+14]=pa.z,u.array[v+15]=pa.w,v+=16}else if("faceVertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)Aa=u.value[ua[D]],P=Aa[0],Q=Aa[1],R=Aa[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+
|
|
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]=pa.x,u.array[v+13]=pa.y,u.array[v+14]=pa.z,u.array[v+15]=pa.w,v+=16}else if("faceVertices"===u.boundTo){D=0;for(V=ua.length;D<V;D++)Aa=u.value[ua[D]],P=Aa[0],Q=Aa[1],R=Aa[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;D=0;for(V=va.length;D<V;D++)Aa=u.value[va[D]],P=Aa[0],Q=Aa[1],R=Aa[2],pa=Aa[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]=pa.x,u.array[v+13]=pa.y,u.array[v+14]=pa.z,u.array[v+15]=pa.w,v+=16}j.bindBuffer(j.ARRAY_BUFFER,u.buffer);
|
|
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;D=0;for(V=va.length;D<V;D++)Aa=u.value[va[D]],P=Aa[0],Q=Aa[1],R=Aa[2],pa=Aa[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]=pa.x,u.array[v+13]=pa.y,u.array[v+14]=pa.z,u.array[v+15]=pa.w,v+=16}j.bindBuffer(j.ARRAY_BUFFER,u.buffer);
|
|
-j.bufferData(j.ARRAY_BUFFER,u.array,xa)}}Ra&&(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;ia.attributes&&
|
|
|
|
-x(ia)}else if(ma instanceof THREE.Ribbon){ia=e(ma,N);wa=ia.attributes&&t(ia);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.normalsNeedUpdate||wa){var Fb=N,Mc=j.DYNAMIC_DRAW,Dc=void 0,Ec=void 0,Fc=void 0,Nc=void 0,Ba=void 0,Oc=void 0,Pc=void 0,Qc=void 0,md=void 0,gb=void 0,zc=void 0,Ga=void 0,wb=void 0,nd=Fb.vertices,od=Fb.colors,pd=Fb.normals,yd=nd.length,zd=od.length,Ad=pd.length,Rc=Fb.__vertexArray,Sc=Fb.__colorArray,Tc=Fb.__normalArray,Bd=Fb.colorsNeedUpdate,Cd=Fb.normalsNeedUpdate,hd=Fb.__webglCustomAttributesList;
|
|
|
|
|
|
+j.bufferData(j.ARRAY_BUFFER,u.array,xa)}}Va&&(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;ia.attributes&&
|
|
|
|
+x(ia)}else if(ma instanceof THREE.Ribbon){ia=e(ma,N);wa=ia.attributes&&t(ia);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.normalsNeedUpdate||wa){var Fb=N,Mc=j.DYNAMIC_DRAW,Dc=void 0,Ec=void 0,Fc=void 0,Nc=void 0,Ba=void 0,Oc=void 0,Pc=void 0,Qc=void 0,md=void 0,hb=void 0,zc=void 0,Fa=void 0,vb=void 0,nd=Fb.vertices,od=Fb.colors,pd=Fb.normals,yd=nd.length,zd=od.length,Ad=pd.length,Rc=Fb.__vertexArray,Sc=Fb.__colorArray,Tc=Fb.__normalArray,Bd=Fb.colorsNeedUpdate,Cd=Fb.normalsNeedUpdate,hd=Fb.__webglCustomAttributesList;
|
|
if(Fb.verticesNeedUpdate){for(Dc=0;Dc<yd;Dc++)Nc=nd[Dc],Ba=3*Dc,Rc[Ba]=Nc.x,Rc[Ba+1]=Nc.y,Rc[Ba+2]=Nc.z;j.bindBuffer(j.ARRAY_BUFFER,Fb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Rc,Mc)}if(Bd){for(Ec=0;Ec<zd;Ec++)Oc=od[Ec],Ba=3*Ec,Sc[Ba]=Oc.r,Sc[Ba+1]=Oc.g,Sc[Ba+2]=Oc.b;j.bindBuffer(j.ARRAY_BUFFER,Fb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Sc,Mc)}if(Cd){for(Fc=0;Fc<Ad;Fc++)Pc=pd[Fc],Ba=3*Fc,Tc[Ba]=Pc.x,Tc[Ba+1]=Pc.y,Tc[Ba+2]=Pc.z;j.bindBuffer(j.ARRAY_BUFFER,Fb.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,
|
|
if(Fb.verticesNeedUpdate){for(Dc=0;Dc<yd;Dc++)Nc=nd[Dc],Ba=3*Dc,Rc[Ba]=Nc.x,Rc[Ba+1]=Nc.y,Rc[Ba+2]=Nc.z;j.bindBuffer(j.ARRAY_BUFFER,Fb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Rc,Mc)}if(Bd){for(Ec=0;Ec<zd;Ec++)Oc=od[Ec],Ba=3*Ec,Sc[Ba]=Oc.r,Sc[Ba+1]=Oc.g,Sc[Ba+2]=Oc.b;j.bindBuffer(j.ARRAY_BUFFER,Fb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Sc,Mc)}if(Cd){for(Fc=0;Fc<Ad;Fc++)Pc=pd[Fc],Ba=3*Fc,Tc[Ba]=Pc.x,Tc[Ba+1]=Pc.y,Tc[Ba+2]=Pc.z;j.bindBuffer(j.ARRAY_BUFFER,Fb.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,
|
|
-Tc,Mc)}if(hd){Qc=0;for(md=hd.length;Qc<md;Qc++)if(Ga=hd[Qc],Ga.needsUpdate&&(void 0===Ga.boundTo||"vertices"===Ga.boundTo)){Ba=0;zc=Ga.value.length;if(1===Ga.size)for(gb=0;gb<zc;gb++)Ga.array[gb]=Ga.value[gb];else if(2===Ga.size)for(gb=0;gb<zc;gb++)wb=Ga.value[gb],Ga.array[Ba]=wb.x,Ga.array[Ba+1]=wb.y,Ba+=2;else if(3===Ga.size)if("c"===Ga.type)for(gb=0;gb<zc;gb++)wb=Ga.value[gb],Ga.array[Ba]=wb.r,Ga.array[Ba+1]=wb.g,Ga.array[Ba+2]=wb.b,Ba+=3;else for(gb=0;gb<zc;gb++)wb=Ga.value[gb],Ga.array[Ba]=wb.x,
|
|
|
|
-Ga.array[Ba+1]=wb.y,Ga.array[Ba+2]=wb.z,Ba+=3;else if(4===Ga.size)for(gb=0;gb<zc;gb++)wb=Ga.value[gb],Ga.array[Ba]=wb.x,Ga.array[Ba+1]=wb.y,Ga.array[Ba+2]=wb.z,Ga.array[Ba+3]=wb.w,Ba+=4;j.bindBuffer(j.ARRAY_BUFFER,Ga.buffer);j.bufferData(j.ARRAY_BUFFER,Ga.array,Mc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.normalsNeedUpdate=!1;ia.attributes&&x(ia)}else if(ma 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{ia=e(ma,N);wa=ia.attributes&&t(ia);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.lineDistancesNeedUpdate||wa){var Gb=N,Uc=j.DYNAMIC_DRAW,Gc=void 0,Hc=void 0,Ic=void 0,Vc=void 0,La=void 0,Wc=void 0,qd=Gb.vertices,rd=Gb.colors,sd=Gb.lineDistances,Dd=qd.length,Ed=rd.length,Fd=sd.length,Xc=Gb.__vertexArray,Yc=Gb.__colorArray,td=Gb.__lineDistanceArray,Gd=Gb.colorsNeedUpdate,Hd=Gb.lineDistancesNeedUpdate,id=Gb.__webglCustomAttributesList,Zc=void 0,ud=
|
|
|
|
-void 0,hb=void 0,Ac=void 0,xb=void 0,Ha=void 0;if(Gb.verticesNeedUpdate){for(Gc=0;Gc<Dd;Gc++)Vc=qd[Gc],La=3*Gc,Xc[La]=Vc.x,Xc[La+1]=Vc.y,Xc[La+2]=Vc.z;j.bindBuffer(j.ARRAY_BUFFER,Gb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Xc,Uc)}if(Gd){for(Hc=0;Hc<Ed;Hc++)Wc=rd[Hc],La=3*Hc,Yc[La]=Wc.r,Yc[La+1]=Wc.g,Yc[La+2]=Wc.b;j.bindBuffer(j.ARRAY_BUFFER,Gb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Yc,Uc)}if(Hd){for(Ic=0;Ic<Fd;Ic++)td[Ic]=sd[Ic];j.bindBuffer(j.ARRAY_BUFFER,Gb.__webglLineDistanceBuffer);
|
|
|
|
-j.bufferData(j.ARRAY_BUFFER,td,Uc)}if(id){Zc=0;for(ud=id.length;Zc<ud;Zc++)if(Ha=id[Zc],Ha.needsUpdate&&(void 0===Ha.boundTo||"vertices"===Ha.boundTo)){La=0;Ac=Ha.value.length;if(1===Ha.size)for(hb=0;hb<Ac;hb++)Ha.array[hb]=Ha.value[hb];else if(2===Ha.size)for(hb=0;hb<Ac;hb++)xb=Ha.value[hb],Ha.array[La]=xb.x,Ha.array[La+1]=xb.y,La+=2;else if(3===Ha.size)if("c"===Ha.type)for(hb=0;hb<Ac;hb++)xb=Ha.value[hb],Ha.array[La]=xb.r,Ha.array[La+1]=xb.g,Ha.array[La+2]=xb.b,La+=3;else for(hb=0;hb<Ac;hb++)xb=
|
|
|
|
-Ha.value[hb],Ha.array[La]=xb.x,Ha.array[La+1]=xb.y,Ha.array[La+2]=xb.z,La+=3;else if(4===Ha.size)for(hb=0;hb<Ac;hb++)xb=Ha.value[hb],Ha.array[La]=xb.x,Ha.array[La+1]=xb.y,Ha.array[La+2]=xb.z,Ha.array[La+3]=xb.w,La+=4;j.bindBuffer(j.ARRAY_BUFFER,Ha.buffer);j.bufferData(j.ARRAY_BUFFER,Ha.array,Uc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.lineDistancesNeedUpdate=!1;ia.attributes&&x(ia)}else if(ma 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{ia=e(ma,N);wa=ia.attributes&&t(ia);if(N.verticesNeedUpdate||N.colorsNeedUpdate||ma.sortParticles||wa){var $b=N,jd=j.DYNAMIC_DRAW,Jc=ma,yb=void 0,ac=void 0,bc=void 0,fa=void 0,cc=void 0,qc=void 0,$c=$b.vertices,kd=$c.length,ld=$b.colors,vd=ld.length,vc=$b.__vertexArray,wc=$b.__colorArray,hc=$b.__sortArray,wd=$b.verticesNeedUpdate,xd=$b.colorsNeedUpdate,ic=$b.__webglCustomAttributesList,Ib=void 0,Bc=void 0,na=void 0,Jb=
|
|
|
|
-void 0,Da=void 0,ca=void 0;if(Jc.sortParticles){rc.copy(Mb);rc.multiply(Jc.matrixWorld);for(yb=0;yb<kd;yb++)bc=$c[yb],kb.copy(bc),kb.applyMatrix4(rc),hc[yb]=[kb.z,yb];hc.sort(n);for(yb=0;yb<kd;yb++)bc=$c[hc[yb][1]],fa=3*yb,vc[fa]=bc.x,vc[fa+1]=bc.y,vc[fa+2]=bc.z;for(ac=0;ac<vd;ac++)fa=3*ac,qc=ld[hc[ac][1]],wc[fa]=qc.r,wc[fa+1]=qc.g,wc[fa+2]=qc.b;if(ic){Ib=0;for(Bc=ic.length;Ib<Bc;Ib++)if(ca=ic[Ib],void 0===ca.boundTo||"vertices"===ca.boundTo)if(fa=0,Jb=ca.value.length,1===ca.size)for(na=0;na<Jb;na++)cc=
|
|
|
|
|
|
+Tc,Mc)}if(hd){Qc=0;for(md=hd.length;Qc<md;Qc++)if(Fa=hd[Qc],Fa.needsUpdate&&(void 0===Fa.boundTo||"vertices"===Fa.boundTo)){Ba=0;zc=Fa.value.length;if(1===Fa.size)for(hb=0;hb<zc;hb++)Fa.array[hb]=Fa.value[hb];else if(2===Fa.size)for(hb=0;hb<zc;hb++)vb=Fa.value[hb],Fa.array[Ba]=vb.x,Fa.array[Ba+1]=vb.y,Ba+=2;else if(3===Fa.size)if("c"===Fa.type)for(hb=0;hb<zc;hb++)vb=Fa.value[hb],Fa.array[Ba]=vb.r,Fa.array[Ba+1]=vb.g,Fa.array[Ba+2]=vb.b,Ba+=3;else for(hb=0;hb<zc;hb++)vb=Fa.value[hb],Fa.array[Ba]=vb.x,
|
|
|
|
+Fa.array[Ba+1]=vb.y,Fa.array[Ba+2]=vb.z,Ba+=3;else if(4===Fa.size)for(hb=0;hb<zc;hb++)vb=Fa.value[hb],Fa.array[Ba]=vb.x,Fa.array[Ba+1]=vb.y,Fa.array[Ba+2]=vb.z,Fa.array[Ba+3]=vb.w,Ba+=4;j.bindBuffer(j.ARRAY_BUFFER,Fa.buffer);j.bufferData(j.ARRAY_BUFFER,Fa.array,Mc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.normalsNeedUpdate=!1;ia.attributes&&x(ia)}else if(ma 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{ia=e(ma,N);wa=ia.attributes&&t(ia);if(N.verticesNeedUpdate||N.colorsNeedUpdate||N.lineDistancesNeedUpdate||wa){var Gb=N,Uc=j.DYNAMIC_DRAW,Gc=void 0,Hc=void 0,Ic=void 0,Vc=void 0,Ka=void 0,Wc=void 0,qd=Gb.vertices,rd=Gb.colors,sd=Gb.lineDistances,Dd=qd.length,Ed=rd.length,Fd=sd.length,Xc=Gb.__vertexArray,Yc=Gb.__colorArray,td=Gb.__lineDistanceArray,Gd=Gb.colorsNeedUpdate,Hd=Gb.lineDistancesNeedUpdate,id=Gb.__webglCustomAttributesList,Zc=void 0,ud=
|
|
|
|
+void 0,ib=void 0,Ac=void 0,wb=void 0,Ga=void 0;if(Gb.verticesNeedUpdate){for(Gc=0;Gc<Dd;Gc++)Vc=qd[Gc],Ka=3*Gc,Xc[Ka]=Vc.x,Xc[Ka+1]=Vc.y,Xc[Ka+2]=Vc.z;j.bindBuffer(j.ARRAY_BUFFER,Gb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Xc,Uc)}if(Gd){for(Hc=0;Hc<Ed;Hc++)Wc=rd[Hc],Ka=3*Hc,Yc[Ka]=Wc.r,Yc[Ka+1]=Wc.g,Yc[Ka+2]=Wc.b;j.bindBuffer(j.ARRAY_BUFFER,Gb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Yc,Uc)}if(Hd){for(Ic=0;Ic<Fd;Ic++)td[Ic]=sd[Ic];j.bindBuffer(j.ARRAY_BUFFER,Gb.__webglLineDistanceBuffer);
|
|
|
|
+j.bufferData(j.ARRAY_BUFFER,td,Uc)}if(id){Zc=0;for(ud=id.length;Zc<ud;Zc++)if(Ga=id[Zc],Ga.needsUpdate&&(void 0===Ga.boundTo||"vertices"===Ga.boundTo)){Ka=0;Ac=Ga.value.length;if(1===Ga.size)for(ib=0;ib<Ac;ib++)Ga.array[ib]=Ga.value[ib];else if(2===Ga.size)for(ib=0;ib<Ac;ib++)wb=Ga.value[ib],Ga.array[Ka]=wb.x,Ga.array[Ka+1]=wb.y,Ka+=2;else if(3===Ga.size)if("c"===Ga.type)for(ib=0;ib<Ac;ib++)wb=Ga.value[ib],Ga.array[Ka]=wb.r,Ga.array[Ka+1]=wb.g,Ga.array[Ka+2]=wb.b,Ka+=3;else for(ib=0;ib<Ac;ib++)wb=
|
|
|
|
+Ga.value[ib],Ga.array[Ka]=wb.x,Ga.array[Ka+1]=wb.y,Ga.array[Ka+2]=wb.z,Ka+=3;else if(4===Ga.size)for(ib=0;ib<Ac;ib++)wb=Ga.value[ib],Ga.array[Ka]=wb.x,Ga.array[Ka+1]=wb.y,Ga.array[Ka+2]=wb.z,Ga.array[Ka+3]=wb.w,Ka+=4;j.bindBuffer(j.ARRAY_BUFFER,Ga.buffer);j.bufferData(j.ARRAY_BUFFER,Ga.array,Uc)}}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;N.lineDistancesNeedUpdate=!1;ia.attributes&&x(ia)}else if(ma 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{ia=e(ma,N);wa=ia.attributes&&t(ia);if(N.verticesNeedUpdate||N.colorsNeedUpdate||ma.sortParticles||wa){var $b=N,jd=j.DYNAMIC_DRAW,Jc=ma,xb=void 0,ac=void 0,bc=void 0,fa=void 0,cc=void 0,qc=void 0,$c=$b.vertices,kd=$c.length,ld=$b.colors,vd=ld.length,vc=$b.__vertexArray,wc=$b.__colorArray,hc=$b.__sortArray,wd=$b.verticesNeedUpdate,xd=$b.colorsNeedUpdate,ic=$b.__webglCustomAttributesList,Ib=void 0,Bc=void 0,na=void 0,Jb=
|
|
|
|
+void 0,Da=void 0,ca=void 0;if(Jc.sortParticles){rc.copy(Mb);rc.multiply(Jc.matrixWorld);for(xb=0;xb<kd;xb++)bc=$c[xb],lb.copy(bc),lb.applyMatrix4(rc),hc[xb]=[lb.z,xb];hc.sort(n);for(xb=0;xb<kd;xb++)bc=$c[hc[xb][1]],fa=3*xb,vc[fa]=bc.x,vc[fa+1]=bc.y,vc[fa+2]=bc.z;for(ac=0;ac<vd;ac++)fa=3*ac,qc=ld[hc[ac][1]],wc[fa]=qc.r,wc[fa+1]=qc.g,wc[fa+2]=qc.b;if(ic){Ib=0;for(Bc=ic.length;Ib<Bc;Ib++)if(ca=ic[Ib],void 0===ca.boundTo||"vertices"===ca.boundTo)if(fa=0,Jb=ca.value.length,1===ca.size)for(na=0;na<Jb;na++)cc=
|
|
hc[na][1],ca.array[na]=ca.value[cc];else if(2===ca.size)for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,fa+=2;else if(3===ca.size)if("c"===ca.type)for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.r,ca.array[fa+1]=Da.g,ca.array[fa+2]=Da.b,fa+=3;else for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,fa+=3;else if(4===ca.size)for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.x,
|
|
hc[na][1],ca.array[na]=ca.value[cc];else if(2===ca.size)for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,fa+=2;else if(3===ca.size)if("c"===ca.type)for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.r,ca.array[fa+1]=Da.g,ca.array[fa+2]=Da.b,fa+=3;else for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,fa+=3;else if(4===ca.size)for(na=0;na<Jb;na++)cc=hc[na][1],Da=ca.value[cc],ca.array[fa]=Da.x,
|
|
-ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,ca.array[fa+3]=Da.w,fa+=4}}else{if(wd)for(yb=0;yb<kd;yb++)bc=$c[yb],fa=3*yb,vc[fa]=bc.x,vc[fa+1]=bc.y,vc[fa+2]=bc.z;if(xd)for(ac=0;ac<vd;ac++)qc=ld[ac],fa=3*ac,wc[fa]=qc.r,wc[fa+1]=qc.g,wc[fa+2]=qc.b;if(ic){Ib=0;for(Bc=ic.length;Ib<Bc;Ib++)if(ca=ic[Ib],ca.needsUpdate&&(void 0===ca.boundTo||"vertices"===ca.boundTo))if(Jb=ca.value.length,fa=0,1===ca.size)for(na=0;na<Jb;na++)ca.array[na]=ca.value[na];else if(2===ca.size)for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=
|
|
|
|
|
|
+ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,ca.array[fa+3]=Da.w,fa+=4}}else{if(wd)for(xb=0;xb<kd;xb++)bc=$c[xb],fa=3*xb,vc[fa]=bc.x,vc[fa+1]=bc.y,vc[fa+2]=bc.z;if(xd)for(ac=0;ac<vd;ac++)qc=ld[ac],fa=3*ac,wc[fa]=qc.r,wc[fa+1]=qc.g,wc[fa+2]=qc.b;if(ic){Ib=0;for(Bc=ic.length;Ib<Bc;Ib++)if(ca=ic[Ib],ca.needsUpdate&&(void 0===ca.boundTo||"vertices"===ca.boundTo))if(Jb=ca.value.length,fa=0,1===ca.size)for(na=0;na<Jb;na++)ca.array[na]=ca.value[na];else if(2===ca.size)for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=
|
|
Da.x,ca.array[fa+1]=Da.y,fa+=2;else if(3===ca.size)if("c"===ca.type)for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=Da.r,ca.array[fa+1]=Da.g,ca.array[fa+2]=Da.b,fa+=3;else for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,fa+=3;else if(4===ca.size)for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,ca.array[fa+3]=Da.w,fa+=4}}if(wd||Jc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,$b.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
Da.x,ca.array[fa+1]=Da.y,fa+=2;else if(3===ca.size)if("c"===ca.type)for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=Da.r,ca.array[fa+1]=Da.g,ca.array[fa+2]=Da.b,fa+=3;else for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,fa+=3;else if(4===ca.size)for(na=0;na<Jb;na++)Da=ca.value[na],ca.array[fa]=Da.x,ca.array[fa+1]=Da.y,ca.array[fa+2]=Da.z,ca.array[fa+3]=Da.w,fa+=4}}if(wd||Jc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,$b.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,
|
|
-vc,jd);if(xd||Jc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,$b.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,wc,jd);if(ic){Ib=0;for(Bc=ic.length;Ib<Bc;Ib++)if(ca=ic[Ib],ca.needsUpdate||Jc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,ca.buffer),j.bufferData(j.ARRAY_BUFFER,ca.array,jd)}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;ia.attributes&&x(ia)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Sa);var i,k,n,l,m;a instanceof THREE.MeshDepthMaterial?m="depth":a instanceof
|
|
|
|
|
|
+vc,jd);if(xd||Jc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,$b.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,wc,jd);if(ic){Ib=0;for(Bc=ic.length;Ib<Bc;Ib++)if(ca=ic[Ib],ca.needsUpdate||Jc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,ca.buffer),j.bufferData(j.ARRAY_BUFFER,ca.array,jd)}}N.verticesNeedUpdate=!1;N.colorsNeedUpdate=!1;ia.attributes&&x(ia)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Qa);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=
|
|
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&&
|
|
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,
|
|
(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,
|
|
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=ha.length;t<x;t++)if(d=ha[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");
|
|
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=ha.length;t<x;t++)if(d=ha[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 "+T+" float;",d,eb?"#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,
|
|
|
|
|
|
+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 "+T+" float;",d,fb?"#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):
|
|
"#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");
|
|
"",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 "+T+" 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":"",
|
|
t=["precision "+T+" 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":"",
|
|
@@ -476,15 +476,15 @@ c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.
|
|
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"+
|
|
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=ta++;ha.push({program:w,code:m,usedTimes:1});M.info.memory.programs=ha.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=
|
|
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=ta++;ha.push({program:w,code:m,usedTimes:1});M.info.memory.programs=ha.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;ma!==
|
|
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;ma!==
|
|
-b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),ma=b);wa!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),wa=a)};this.setDepthTest=function(a){qb!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),qb=a)};this.setDepthWrite=function(a){tb!==a&&(j.depthMask(a),tb=a)};this.setBlending=function(a,b,c,d){a!==xa&&(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)),xa=a);if(a===THREE.CustomBlending){if(b!==ea&&(j.blendEquation(K(b)),ea=b),c!==Va||d!==ob)j.blendFunc(K(c),K(d)),Va=c,ob=d}else ob=
|
|
|
|
-Va=ea=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",pb),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),
|
|
|
|
|
|
+b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),ma=b);wa!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),wa=a)};this.setDepthTest=function(a){qb!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),qb=a)};this.setDepthWrite=function(a){Sa!==a&&(j.depthMask(a),Sa=a)};this.setBlending=function(a,b,c,d){a!==xa&&(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)),xa=a);if(a===THREE.CustomBlending){if(b!==ea&&(j.blendEquation(K(b)),ea=b),c!==Ua||d!==Bb)j.blendFunc(K(c),K(d)),Ua=c,Bb=d}else Bb=
|
|
|
|
+Ua=ea=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",pb),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,
|
|
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",fb);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",gb);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,
|
|
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),
|
|
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,
|
|
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=Ua,d=Fa,e=Ra);b!==da&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(d,e,c,a),da=b);Kb=c;Lb=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=Cb,a=Ta,d=Na,e=Va);b!==da&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(d,e,c,a),da=b);Kb=c;Lb=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};
|
|
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.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];
|
|
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];
|
|
@@ -605,10 +605,10 @@ THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||cons
|
|
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,
|
|
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=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:
|
|
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,C;q&&(l=q.getSpacedPoints(s),r=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(q,s,
|
|
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,C;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,C=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,T,Z=A.length,sa=X.length,Na=[],J=0,ja=q.length;B=ja-1;for(K=J+1;J<ja;J++,B++,K++)B===ja&&
|
|
|
|
-(B=0),K===ja&&(K=0),Na[J]=d(q[J],q[B],q[K]);var ia=[],Qa,M=Na.concat();E=0;for(F=n.length;E<F;E++){y=n[E];Qa=[];J=0;ja=y.length;B=ja-1;for(K=J+1;J<ja;J++,B++,K++)B===ja&&(B=0),K===ja&&(K=0),Qa[J]=d(y[J],y[B],y[K]);ia.push(Qa);M=M.concat(Qa)}for(B=0;B<m;B++){y=B/m;L=h*(1-y);K=k*Math.sin(y*Math.PI/2);J=0;for(ja=q.length;J<ja;J++)T=c(q[J],Na[J],K),f(T.x,T.y,-L);E=0;for(F=n.length;E<F;E++){y=n[E];Qa=ia[E];J=0;for(ja=y.length;J<ja;J++)T=c(y[J],Qa[J],K),f(T.x,T.y,-L)}}K=k;for(J=0;J<Z;J++)T=p?c(A[J],M[J],
|
|
|
|
-K):A[J],r?(H.copy(w.normals[0]).multiplyScalar(T.x),I.copy(w.binormals[0]).multiplyScalar(T.y),C.copy(l[0]).add(H).add(I),f(C.x,C.y,C.z)):f(T.x,T.y,0);for(y=1;y<=s;y++)for(J=0;J<Z;J++)T=p?c(A[J],M[J],K):A[J],r?(H.copy(w.normals[y]).multiplyScalar(T.x),I.copy(w.binormals[y]).multiplyScalar(T.y),C.copy(l[y]).add(H).add(I),f(C.x,C.y,C.z)):f(T.x,T.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(ja=q.length;J<ja;J++)T=c(q[J],Na[J],K),f(T.x,T.y,i+L);E=0;for(F=n.length;E<F;E++){y=
|
|
|
|
-n[E];Qa=ia[E];J=0;for(ja=y.length;J<ja;J++)T=c(y[J],Qa[J],K),r?f(T.x,T.y+l[s-1].y,l[s-1].x+L):f(T.x,T.y,i+L)}}if(p){h=0*Z;for(J=0;J<sa;J++)i=X[J],g(i[2]+h,i[1]+h,i[0]+h,!0);h=Z*(s+2*m);for(J=0;J<sa;J++)i=X[J],g(i[0]+h,i[1]+h,i[2]+h,!1)}else{for(J=0;J<sa;J++)i=X[J],g(i[2],i[1],i[0],!0);for(J=0;J<sa;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,C=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,T,Z=A.length,sa=X.length,La=[],J=0,ja=q.length;B=ja-1;for(K=J+1;J<ja;J++,B++,K++)B===ja&&
|
|
|
|
+(B=0),K===ja&&(K=0),La[J]=d(q[J],q[B],q[K]);var ia=[],Pa,M=La.concat();E=0;for(F=n.length;E<F;E++){y=n[E];Pa=[];J=0;ja=y.length;B=ja-1;for(K=J+1;J<ja;J++,B++,K++)B===ja&&(B=0),K===ja&&(K=0),Pa[J]=d(y[J],y[B],y[K]);ia.push(Pa);M=M.concat(Pa)}for(B=0;B<m;B++){y=B/m;L=h*(1-y);K=k*Math.sin(y*Math.PI/2);J=0;for(ja=q.length;J<ja;J++)T=c(q[J],La[J],K),f(T.x,T.y,-L);E=0;for(F=n.length;E<F;E++){y=n[E];Pa=ia[E];J=0;for(ja=y.length;J<ja;J++)T=c(y[J],Pa[J],K),f(T.x,T.y,-L)}}K=k;for(J=0;J<Z;J++)T=p?c(A[J],M[J],
|
|
|
|
+K):A[J],r?(H.copy(w.normals[0]).multiplyScalar(T.x),I.copy(w.binormals[0]).multiplyScalar(T.y),C.copy(l[0]).add(H).add(I),f(C.x,C.y,C.z)):f(T.x,T.y,0);for(y=1;y<=s;y++)for(J=0;J<Z;J++)T=p?c(A[J],M[J],K):A[J],r?(H.copy(w.normals[y]).multiplyScalar(T.x),I.copy(w.binormals[y]).multiplyScalar(T.y),C.copy(l[y]).add(H).add(I),f(C.x,C.y,C.z)):f(T.x,T.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(ja=q.length;J<ja;J++)T=c(q[J],La[J],K),f(T.x,T.y,i+L);E=0;for(F=n.length;E<F;E++){y=
|
|
|
|
+n[E];Pa=ia[E];J=0;for(ja=y.length;J<ja;J++)T=c(y[J],Pa[J],K),r?f(T.x,T.y+l[s-1].y,l[s-1].x+L):f(T.x,T.y,i+L)}}if(p){h=0*Z;for(J=0;J<sa;J++)i=X[J],g(i[2]+h,i[1]+h,i[0]+h,!0);h=Z*(s+2*m);for(J=0;J<sa;J++)i=X[J],g(i[0]+h,i[1]+h,i[2]+h,!1)}else{for(J=0;J<sa;J++)i=X[J],g(i[2],i[1],i[0],!0);for(J=0;J<sa;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};
|
|
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,
|
|
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;
|
|
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};
|
|
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};
|