提交 72322e16 编写于 作者: M Mr.doob

Updated builds.

上级 b702d22b
......@@ -8430,6 +8430,8 @@ THREE.Projector = function () {
vertices = object.geometry.vertices;
if ( vertices.length === 0 ) continue;
v1 = getNextVertexInPool();
v1.positionScreen.copy( vertices[ 0 ] ).applyMatrix4( _modelViewProjectionMatrix );
......
......@@ -174,9 +174,10 @@ THREE.BufferGeometry){if(y=s.attributes,x=s.offsets,void 0!==y.position){F=y.pos
for(Ta=x.length;ka<Ta;ka++){v=x[ka];var va=!0===F?E.materials[v.materialIndex]:p.material;if(void 0!==va){A=va.side;var la=q[v.a],Ka=q[v.b],La=q[v.c];if(!0===va.morphTargets){z=s.morphTargets;var Ga=p.morphTargetInfluences,ca=la.position,wa=Ka.position,Ma=La.position;M.set(0,0,0);H.set(0,0,0);K.set(0,0,0);for(var Pa=0,Qa=z.length;Pa<Qa;Pa++){var ma=Ga[Pa];if(0!==ma){var Ea=z[Pa].vertices;M.x+=(Ea[v.a].x-ca.x)*ma;M.y+=(Ea[v.a].y-ca.y)*ma;M.z+=(Ea[v.a].z-ca.z)*ma;H.x+=(Ea[v.b].x-wa.x)*ma;H.y+=(Ea[v.b].y-
wa.y)*ma;H.z+=(Ea[v.b].z-wa.z)*ma;K.x+=(Ea[v.c].x-Ma.x)*ma;K.y+=(Ea[v.c].y-Ma.y)*ma;K.z+=(Ea[v.c].z-Ma.z)*ma}}la.position.add(M);Ka.position.add(H);La.position.add(K);I.projectVertex(la);I.projectVertex(Ka);I.projectVertex(La)}Ga=I.checkTriangleVisibility(la,Ka,La);if(Ga!==(A===THREE.BackSide)){t=b();t.id=p.id;t.v1.copy(la);t.v2.copy(Ka);t.v3.copy(La);t.normalModel.copy(v.normal);!1!==Ga||A!==THREE.BackSide&&A!==THREE.DoubleSide||t.normalModel.negate();t.normalModel.applyMatrix3(W).normalize();t.centroidModel.copy(v.centroid).applyMatrix4(R);
z=v.vertexNormals;ca=0;for(wa=Math.min(z.length,3);ca<wa;ca++)Ma=t.vertexNormalsModel[ca],Ma.copy(z[ca]),!1!==Ga||A!==THREE.BackSide&&A!==THREE.DoubleSide||Ma.negate(),Ma.applyMatrix3(W).normalize();t.vertexNormalsLength=z.length;z=0;for(Ga=Math.min(y.length,3);z<Ga;z++)if(A=y[z][ka],void 0!==A)for(ca=0,wa=A.length;ca<wa;ca++)t.uvs[z][ca]=A[ca];t.color=v.color;t.material=va;t.z=(la.positionScreen.z+Ka.positionScreen.z+La.positionScreen.z)/3;B.elements.push(t)}}}}}else if(p instanceof THREE.Line)if(s instanceof
THREE.BufferGeometry){if(y=s.attributes,void 0!==y.position){F=y.position.array;p=0;for(s=F.length;p<s;p+=3)I.pushVertex(F[p],F[p+1],F[p+2]);if(void 0!==y.index)for(y=y.index.array,p=0,s=y.length;p<s;p+=2)I.pushLine(y[p],y[p+1]);else for(p=0,s=F.length/3-1;p<s;p++)I.pushLine(p,p+1)}}else{if(s instanceof THREE.Geometry)for(ja.multiplyMatrices(X,R),v=p.geometry.vertices,la=a(),la.positionScreen.copy(v[0]).applyMatrix4(ja),s=p.type===THREE.LinePieces?2:1,ka=1,Ta=v.length;ka<Ta;ka++)la=a(),la.positionScreen.copy(v[ka]).applyMatrix4(ja),
0<(ka+1)%s||(Ka=q[n-2],D.copy(la.positionScreen),da.copy(Ka.positionScreen),!0===e(D,da)&&(D.multiplyScalar(1/D.w),da.multiplyScalar(1/da.w),w=c(),w.id=p.id,w.v1.positionScreen.copy(D),w.v2.positionScreen.copy(da),w.z=Math.max(D.z,da.z),w.material=p.material,p.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(p.geometry.colors[ka]),w.vertexColors[1].copy(p.geometry.colors[ka-1])),B.elements.push(w)))}else p instanceof THREE.Sprite&&(N.set(R.elements[12],R.elements[13],R.elements[14],
1),N.applyMatrix4(X),s=1/N.w,N.z*=s,-1<=N.z&&1>=N.z&&(Q===C?(x=new THREE.RenderableSprite,J.push(x),C++,Q++,G=x):G=J[Q++],G.id=p.id,G.x=N.x*s,G.y=N.y*s,G.z=N.z,G.object=p,G.rotation=p.rotation,G.scale.x=p.scale.x*Math.abs(G.x-(N.x+h.projectionMatrix.elements[0])/(N.w+h.projectionMatrix.elements[12])),G.scale.y=p.scale.y*Math.abs(G.y-(N.y+h.projectionMatrix.elements[5])/(N.w+h.projectionMatrix.elements[13])),G.material=p.material,B.elements.push(G)));!0===l&&B.elements.sort(d);return B}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
THREE.BufferGeometry){if(y=s.attributes,void 0!==y.position){F=y.position.array;p=0;for(s=F.length;p<s;p+=3)I.pushVertex(F[p],F[p+1],F[p+2]);if(void 0!==y.index)for(y=y.index.array,p=0,s=y.length;p<s;p+=2)I.pushLine(y[p],y[p+1]);else for(p=0,s=F.length/3-1;p<s;p++)I.pushLine(p,p+1)}}else{if(s instanceof THREE.Geometry&&(ja.multiplyMatrices(X,R),v=p.geometry.vertices,0!==v.length))for(la=a(),la.positionScreen.copy(v[0]).applyMatrix4(ja),s=p.type===THREE.LinePieces?2:1,ka=1,Ta=v.length;ka<Ta;ka++)la=
a(),la.positionScreen.copy(v[ka]).applyMatrix4(ja),0<(ka+1)%s||(Ka=q[n-2],D.copy(la.positionScreen),da.copy(Ka.positionScreen),!0===e(D,da)&&(D.multiplyScalar(1/D.w),da.multiplyScalar(1/da.w),w=c(),w.id=p.id,w.v1.positionScreen.copy(D),w.v2.positionScreen.copy(da),w.z=Math.max(D.z,da.z),w.material=p.material,p.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(p.geometry.colors[ka]),w.vertexColors[1].copy(p.geometry.colors[ka-1])),B.elements.push(w)))}else p instanceof THREE.Sprite&&
(N.set(R.elements[12],R.elements[13],R.elements[14],1),N.applyMatrix4(X),s=1/N.w,N.z*=s,-1<=N.z&&1>=N.z&&(Q===C?(x=new THREE.RenderableSprite,J.push(x),C++,Q++,G=x):G=J[Q++],G.id=p.id,G.x=N.x*s,G.y=N.y*s,G.z=N.z,G.object=p,G.rotation=p.rotation,G.scale.x=p.scale.x*Math.abs(G.x-(N.x+h.projectionMatrix.elements[0])/(N.w+h.projectionMatrix.elements[12])),G.scale.y=p.scale.y*Math.abs(G.y-(N.y+h.projectionMatrix.elements[5])/(N.w+h.projectionMatrix.elements[13])),G.material=p.material,B.elements.push(G)));
!0===l&&B.elements.sort(d);return B}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册