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

Updated builds.

上级 2c4729d4
......@@ -8167,7 +8167,7 @@ THREE.Projector = function () {
} else {
for ( var i = 0, l = positions.length; i < l; i += 3 ) {
for ( var i = 0, l = positions.length / 3; i < l; i += 3 ) {
renderState.handleTriangle( i, i + 1, i + 2 );
......
......@@ -168,7 +168,7 @@ b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c
a instanceof THREE.Sprite&&H.sprites.push(ia(a));for(var b=0,c=a.children.length;b<c;b++)Ha(a.children[b])}},da=new function(){var c=null,d=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(S);c.copy(b).applyMatrix4(E);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},e=function(a,b,c){A[0]=a.positionScreen;A[1]=b.positionScreen;A[2]=c.positionScreen;return!0===a.visible||!0===b.visible||!0===c.visible||y.isIntersectionBox(L.setFromPoints(A))?
0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x):!1};return{setObject:function(a){c=a},projectVertex:d,checkTriangleVisibility:e,handleVertex:function(b,c,e){i=a();i.position.set(b,c,e);d(i)},handleTriangle:function(a,d,f){a=n[a];d=n[d];f=n[f];!0===e(a,d,f)&&(p=b(),p.id=c.id,p.v1.copy(a),p.v2.copy(d),p.v3.copy(f),p.material=c.material,H.elements.push(p))}}};this.projectScene=function(e,
h,g,i){var l,m,s,x,A,y,L,X,ia;D=u=t=0;H.elements.length=0;!0===e.autoUpdate&&e.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();M.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));E.multiplyMatrices(h.projectionMatrix,M);G.getNormalMatrix(M);ca.setFromMatrix(E);f=0;H.objects.length=0;H.sprites.length=0;H.lights.length=0;Ha(e);!0===g&&H.objects.sort(c);e=0;for(g=H.objects.length;e<g;e++)if(l=H.objects[e].object,da.setObject(l),S=l.matrixWorld,k=0,l instanceof THREE.Mesh)if(m=l.geometry,
m instanceof THREE.BufferGeometry){if(x=m.attributes,void 0!==x.position){y=x.position.array;l=0;for(m=y.length;l<m;l+=3)da.handleVertex(y[l],y[l+1],y[l+2]);if(void 0!==x.index){x=x.index.array;l=0;for(m=x.length;l<m;l+=3)da.handleTriangle(x[l],x[l+1],x[l+2])}else{l=0;for(m=y.length;l<m;l+=3)da.handleTriangle(l,l+1,l+2)}}}else{if(m instanceof THREE.Geometry){s=m.vertices;x=m.faces;y=m.faceVertexUvs;Aa.getNormalMatrix(S);X=l.material instanceof THREE.MeshFaceMaterial;ia=!0===X?l.material:null;for(var la=
m instanceof THREE.BufferGeometry){if(x=m.attributes,void 0!==x.position){y=x.position.array;l=0;for(m=y.length;l<m;l+=3)da.handleVertex(y[l],y[l+1],y[l+2]);if(void 0!==x.index){x=x.index.array;l=0;for(m=x.length;l<m;l+=3)da.handleTriangle(x[l],x[l+1],x[l+2])}else{l=0;for(m=y.length/3;l<m;l+=3)da.handleTriangle(l,l+1,l+2)}}}else{if(m instanceof THREE.Geometry){s=m.vertices;x=m.faces;y=m.faceVertexUvs;Aa.getNormalMatrix(S);X=l.material instanceof THREE.MeshFaceMaterial;ia=!0===X?l.material:null;for(var la=
0,va=s.length;la<va;la++){var xa=s[la];da.handleVertex(xa.x,xa.y,xa.z)}la=0;for(va=x.length;la<va;la++)if(s=x[la],xa=!0===X?ia.materials[s.materialIndex]:l.material,void 0!==xa){L=xa.side;A=n[s.a];var ea=n[s.b],qa=n[s.c];if(!0===xa.morphTargets){var Ia=m.morphTargets,ma=l.morphTargetInfluences,ya=A.position,Wa=ea.position,La=qa.position;w.set(0,0,0);I.set(0,0,0);N.set(0,0,0);for(var Da=0,R=Ia.length;Da<R;Da++){var ba=ma[Da];if(0!==ba){var Ja=Ia[Da].vertices;w.x+=(Ja[s.a].x-ya.x)*ba;w.y+=(Ja[s.a].y-
ya.y)*ba;w.z+=(Ja[s.a].z-ya.z)*ba;I.x+=(Ja[s.b].x-Wa.x)*ba;I.y+=(Ja[s.b].y-Wa.y)*ba;I.z+=(Ja[s.b].z-Wa.z)*ba;N.x+=(Ja[s.c].x-La.x)*ba;N.y+=(Ja[s.c].y-La.y)*ba;N.z+=(Ja[s.c].z-La.z)*ba}}A.position.add(w);ea.position.add(I);qa.position.add(N);da.projectVertex(A);da.projectVertex(ea);da.projectVertex(qa)}Ia=da.checkTriangleVisibility(A,ea,qa);if(Ia!==(L===THREE.BackSide)){p=b();p.id=l.id;p.v1.copy(A);p.v2.copy(ea);p.v3.copy(qa);p.normalModel.copy(s.normal);!1===Ia&&(L===THREE.BackSide||L===THREE.DoubleSide)&&
p.normalModel.negate();p.normalModel.applyMatrix3(Aa).normalize();p.normalModelView.copy(p.normalModel).applyMatrix3(G);p.centroidModel.copy(s.centroid).applyMatrix4(S);A=s.vertexNormals;ea=0;for(qa=Math.min(A.length,3);ea<qa;ea++)ma=p.vertexNormalsModel[ea],ma.copy(A[ea]),!1===Ia&&(L===THREE.BackSide||L===THREE.DoubleSide)&&ma.negate(),ma.applyMatrix3(Aa).normalize(),p.vertexNormalsModelView[ea].copy(ma).applyMatrix3(G);p.vertexNormalsLength=A.length;A=0;for(ea=Math.min(y.length,3);A<ea;A++)if(L=
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册