|
@@ -624,8 +624,8 @@ THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*
|
|
|
THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
|
|
|
THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,q){var w,v=h.widthSegments,t=h.heightSegments,y=e/2,E=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)w="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)w="y",t=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)w="x",v=h.depthSegments;var I=v+1,A=t+1,D=e/v,L=f/t,z=new THREE.Vector3;z[w]=0<g?1:-1;for(e=0;e<A;e++)for(f=0;f<I;f++){var G=new THREE.Vector3;G[a]=(f*D-y)*c;G[b]=(e*L-E)*d;G[w]=g;h.vertices.push(G)}for(e=
|
|
|
0;e<t;e++)for(f=0;f<v;f++)E=f+I*e,a=f+I*(e+1),b=f+1+I*(e+1),c=f+1+I*e,d=new THREE.Vector2(f/v,1-e/t),g=new THREE.Vector2(f/v,1-(e+1)/t),w=new THREE.Vector2((f+1)/v,1-(e+1)/t),y=new THREE.Vector2((f+1)/v,1-e/t),E=new THREE.Face3(E+x,a+x,c+x),E.normal.copy(z),E.vertexNormals.push(z.clone(),z.clone(),z.clone()),E.materialIndex=q,h.faces.push(E),h.faceVertexUvs[0].push([d,g,y]),E=new THREE.Face3(a+x,b+x,c+x),E.normal.copy(z),E.vertexNormals.push(z.clone(),z.clone(),z.clone()),E.materialIndex=q,h.faces.push(E),
|
|
|
-h.faceVertexUvs[0].push([g.clone(),w,y.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=new Uint16Array(3*(b+1)),f=new Float32Array(3*(b+2)),g=new Float32Array(3*(b+2)),h=new Float32Array(2*(b+2));g[2]=1;h[0]=0.5;h[1]=0.5;for(var k=3,l=2,n=0;n<=b;n++){var r=c+n/b*d,p=a*Math.cos(r),r=a*Math.sin(r);f[k]=p;f[k+1]=r;g[k+2]=1;h[l]=(p/a+1)/2;h[l+1]=(r/a+1)/2;e[k]=n+1;e[k+1]=n+2;e[k+2]=0;k+=3;l+=2}THREE.IndexedGeometry2.call(this,
|
|
|
-e,f,g,h);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.IndexedGeometry2.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("DEPRECATED: THREE.CubeGeometry is deprecated. Use THREE.BoxGeometry instead.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var r=[],p=[],s=k/e,u=s*(b-a)+a;for(h=0;h<=d;h++){var q=h/d,w=new THREE.Vector3;w.x=u*Math.sin(q*Math.PI*2);w.y=-s*c+g;w.z=u*Math.cos(q*Math.PI*2);this.vertices.push(w);r.push(this.vertices.length-1);p.push(new THREE.Vector2(q,
|
|
|
+h.faceVertexUvs[0].push([g.clone(),w,y.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Uint16Array(3*b),g=new Float32Array(3*e),h=new Float32Array(3*e),e=new Float32Array(2*e);h[2]=1;e[0]=0.5;e[1]=0.5;for(var k=0,l=2,n=3,r=0;r<=b;r++){var p=c+r/b*d,s=a*Math.cos(p),p=a*Math.sin(p);g[n]=s;g[n+1]=p;h[n+2]=1;e[l]=(s/a+1)/2;e[l+1]=(p/a+1)/2;l+=2;n+=3;f[k]=0;f[k+1]=r+1;f[k+2]=r+2;k+=3}THREE.IndexedGeometry2.call(this,
|
|
|
+f,g,h,e);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.IndexedGeometry2.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("DEPRECATED: THREE.CubeGeometry is deprecated. Use THREE.BoxGeometry instead.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var r=[],p=[],s=k/e,u=s*(b-a)+a;for(h=0;h<=d;h++){var q=h/d,w=new THREE.Vector3;w.x=u*Math.sin(q*Math.PI*2);w.y=-s*c+g;w.z=u*Math.cos(q*Math.PI*2);this.vertices.push(w);r.push(this.vertices.length-1);p.push(new THREE.Vector2(q,
|
|
|
1-s))}l.push(r);n.push(p)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(r=this.vertices[l[0][h]].clone(),p=this.vertices[l[0][h+1]].clone()):(r=this.vertices[l[1][h]].clone(),p=this.vertices[l[1][h+1]].clone()),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),p.setY(Math.sqrt(p.x*p.x+p.z*p.z)*c).normalize(),k=0;k<e;k++){var s=l[k][h],u=l[k+1][h],q=l[k+1][h+1],w=l[k][h+1],v=r.clone(),t=r.clone(),y=p.clone(),E=p.clone(),x=n[k][h].clone(),I=n[k+1][h].clone(),A=n[k+1][h+1].clone(),D=n[k][h+1].clone();this.faces.push(new THREE.Face3(s,
|
|
|
u,w,[v,t,E]));this.faceVertexUvs[0].push([x,I,D]);this.faces.push(new THREE.Face3(u,q,w,[t.clone(),y,E.clone()]));this.faceVertexUvs[0].push([I.clone(),A,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)s=l[0][h],u=l[0][h+1],q=this.vertices.length-1,v=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),x=n[0][h].clone(),I=n[0][h+1].clone(),A=new THREE.Vector2(I.x,0),this.faces.push(new THREE.Face3(s,u,q,[v,t,y])),this.faceVertexUvs[0].push([x,
|
|
|
I,A]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)s=l[k][h+1],u=l[k][h],q=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),x=n[k][h+1].clone(),I=n[k][h].clone(),A=new THREE.Vector2(I.x,1),this.faces.push(new THREE.Face3(s,u,q,[v,t,y])),this.faceVertexUvs[0].push([x,I,A]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
|