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

Updated builds.

上级 954e55a5
...@@ -29742,19 +29742,15 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { ...@@ -29742,19 +29742,15 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
THREE.ExtrudeGeometry.WorldUVGenerator = { THREE.ExtrudeGeometry.WorldUVGenerator = {
generateTopUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) { generateTopUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) {
var ax = geometry.vertices[ indexA ].x,
ay = geometry.vertices[ indexA ].y, var a = geometry.vertices[ indexA ];
var b = geometry.vertices[ indexB ];
bx = geometry.vertices[ indexB ].x, var c = geometry.vertices[ indexC ];
by = geometry.vertices[ indexB ].y,
cx = geometry.vertices[ indexC ].x,
cy = geometry.vertices[ indexC ].y;
return [ return [
new THREE.Vector2( ax, ay ), new THREE.Vector2( a.x, a.y ),
new THREE.Vector2( bx, by ), new THREE.Vector2( b.x, b.y ),
new THREE.Vector2( cx, cy ) new THREE.Vector2( c.x, c.y )
]; ];
}, },
...@@ -29769,47 +29765,29 @@ THREE.ExtrudeGeometry.WorldUVGenerator = { ...@@ -29769,47 +29765,29 @@ THREE.ExtrudeGeometry.WorldUVGenerator = {
indexA, indexB, indexC, indexD, stepIndex, stepsLength, indexA, indexB, indexC, indexD, stepIndex, stepsLength,
contourIndex1, contourIndex2 ) { contourIndex1, contourIndex2 ) {
var ax = geometry.vertices[ indexA ].x, var a = geometry.vertices[ indexA ];
ay = geometry.vertices[ indexA ].y, var b = geometry.vertices[ indexB ];
az = geometry.vertices[ indexA ].z, var c = geometry.vertices[ indexC ];
var d = geometry.vertices[ indexD ];
bx = geometry.vertices[ indexB ].x,
by = geometry.vertices[ indexB ].y,
bz = geometry.vertices[ indexB ].z,
cx = geometry.vertices[ indexC ].x, if ( Math.abs( a.y - b.y ) < 0.01 ) {
cy = geometry.vertices[ indexC ].y,
cz = geometry.vertices[ indexC ].z,
dx = geometry.vertices[ indexD ].x,
dy = geometry.vertices[ indexD ].y,
dz = geometry.vertices[ indexD ].z;
if ( Math.abs( ay - by ) < 0.01 ) {
return [ return [
new THREE.Vector2( ax, 1 - az ), new THREE.Vector2( a.x, 1 - a.z ),
new THREE.Vector2( bx, 1 - bz ), new THREE.Vector2( b.x, 1 - b.z ),
new THREE.Vector2( cx, 1 - cz ), new THREE.Vector2( c.x, 1 - c.z ),
new THREE.Vector2( dx, 1 - dz ) new THREE.Vector2( d.x, 1 - d.z )
]; ];
} else { } else {
return [ return [
new THREE.Vector2( ay, 1 - az ), new THREE.Vector2( a.y, 1 - a.z ),
new THREE.Vector2( by, 1 - bz ), new THREE.Vector2( b.y, 1 - b.z ),
new THREE.Vector2( cy, 1 - cz ), new THREE.Vector2( c.y, 1 - c.z ),
new THREE.Vector2( dy, 1 - dz ) new THREE.Vector2( d.y, 1 - d.z )
]; ];
} }
} }
}; };
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();
// File:src/extras/geometries/ShapeGeometry.js // File:src/extras/geometries/ShapeGeometry.js
/** /**
......
...@@ -687,9 +687,9 @@ r.reverse();D=0;for(J=Q.length;D<J;D++)y=Q[D],THREE.Shape.Utils.isClockWise(y)&& ...@@ -687,9 +687,9 @@ r.reverse();D=0;for(J=Q.length;D<J;D++)y=Q[D],THREE.Shape.Utils.isClockWise(y)&&
y[R],y[G]);ha.push(ra);Ia=Ia.concat(ra)}for(R=0;R<n;R++){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,-xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),g(P.x,P.y,-xa)}G=m;for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],G):r[L],v?(C.copy(x.normals[0]).multiplyScalar(P.x),F.copy(x.binormals[0]).multiplyScalar(P.y),B.copy(s[0]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,0);for(N=1;N<=t;N++)for(L=0;L<ya;L++)P=q?c(r[L],Ia[L], y[R],y[G]);ha.push(ra);Ia=Ia.concat(ra)}for(R=0;R<n;R++){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,-xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),g(P.x,P.y,-xa)}G=m;for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],G):r[L],v?(C.copy(x.normals[0]).multiplyScalar(P.x),F.copy(x.binormals[0]).multiplyScalar(P.y),B.copy(s[0]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,0);for(N=1;N<=t;N++)for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],
G):r[L],v?(C.copy(x.normals[N]).multiplyScalar(P.x),F.copy(x.binormals[N]).multiplyScalar(P.y),B.copy(s[N]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,h/t*N);for(R=n-1;0<=R;R--){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,h+xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),v?g(P.x,P.y+s[t-1].y,s[t-1].x+xa):g(P.x,P.y,h+xa)}(function(){if(q){var a;a=0*ya;for(L=0;L<sa;L++)la=da[L],f(la[2]+a,la[1]+a,la[0]+a,!0); G):r[L],v?(C.copy(x.normals[N]).multiplyScalar(P.x),F.copy(x.binormals[N]).multiplyScalar(P.y),B.copy(s[N]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,h/t*N);for(R=n-1;0<=R;R--){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,h+xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),v?g(P.x,P.y+s[t-1].y,s[t-1].x+xa):g(P.x,P.y,h+xa)}(function(){if(q){var a;a=0*ya;for(L=0;L<sa;L++)la=da[L],f(la[2]+a,la[1]+a,la[0]+a,!0);
a=t+2*n;a*=ya;for(L=0;L<sa;L++)la=da[L],f(la[0]+a,la[1]+a,la[2]+a,!1)}else{for(L=0;L<sa;L++)la=da[L],f(la[2],la[1],la[0],!0);for(L=0;L<sa;L++)la=da[L],f(la[0]+ya*t,la[1]+ya*t,la[2]+ya*t,!1)}})();(function(){var a=0;e(V,a);a+=V.length;D=0;for(J=Q.length;D<J;D++)y=Q[D],e(y,a),a+=y.length})()}; a=t+2*n;a*=ya;for(L=0;L<sa;L++)la=da[L],f(la[0]+a,la[1]+a,la[2]+a,!1)}else{for(L=0;L<sa;L++)la=da[L],f(la[2],la[1],la[0],!0);for(L=0;L<sa;L++)la=da[L],f(la[0]+ya*t,la[1]+ya*t,la[2]+ya*t,!1)}})();(function(){var a=0;e(V,a);a+=V.length;D=0;for(J=Q.length;D<J;D++)y=Q[D],e(y,a),a+=y.length})()};
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[g].x;g=a.vertices[g].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,g)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,m,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[g].x;k=a.vertices[g].y;g=a.vertices[g].z;m=a.vertices[f].x; THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[d];e=a.vertices[e];a=a.vertices[g];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(e.x,e.y),new THREE.Vector2(a.x,a.y)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,m,n,q){b=a.vertices[e];g=a.vertices[g];f=a.vertices[f];a=a.vertices[h];return.01>Math.abs(b.y-g.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(g.x,1-g.z),new THREE.Vector2(f.x,
n=a.vertices[f].y;f=a.vertices[f].z;q=a.vertices[h].x;var r=a.vertices[h].y;a=a.vertices[h].z;return.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-g),new THREE.Vector2(m,1-f),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-g),new THREE.Vector2(n,1-f),new THREE.Vector2(r,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; 1-f.z),new THREE.Vector2(a.x,1-a.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(g.y,1-g.z),new THREE.Vector2(f.y,1-f.z),new THREE.Vector2(a.y,1-a.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);
THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);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.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e], THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e],
k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,f,m))}; k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,f,m))};
THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=m*r.x-n*r.y;t.y=n*r.x+m*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*f;d=n+c;var m=n+1+c,n=n+1,r=f*g,t=k*e,p= THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=m*r.x-n*r.y;t.y=n*r.x+m*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*f;d=n+c;var m=n+1+c,n=n+1,r=f*g,t=k*e,p=
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册