|
@@ -214,7 +214,7 @@ this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoin
|
|
|
c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k=this.morphTargets.length,l=this.morphNormals.length;this.geometryGroups=
|
|
|
{};d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l}),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l})),this.geometryGroups[g].faces3.push(d),
|
|
|
this.geometryGroups[g].vertices+=3;this.geometryGroupsList=[];for(var n in this.geometryGroups)this.geometryGroups[n].id=a++,this.geometryGroupsList.push(this.geometryGroups[n])}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},
|
|
|
-dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
|
+dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Geometry2=function(a,b,c){THREE.BufferGeometry.call(this);this.attributes.position={array:a,itemSize:3};this.attributes.normal={array:b,itemSize:3};this.attributes.uv={array:c,itemSize:2}};THREE.Geometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.IndexedGeometry2=function(a,b,c,d){THREE.BufferGeometry.call(this);this.attributes.index={array:a,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:c,itemSize:3};this.attributes.uv={array:d,itemSize:2}};THREE.IndexedGeometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
|
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};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.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};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()};
|
|
@@ -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){THREE.BufferGeometry.call(this);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}this.attributes.index={array:e,itemSize:1};this.attributes.position={array:f,itemSize:3};this.attributes.normal={array:g,itemSize:3};this.attributes.uv={array:h,itemSize:2};this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.BufferGeometry.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=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,
|
|
|
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)};
|
|
@@ -642,8 +642,8 @@ n=a.vertices[g].y;g=a.vertices[g].z;r=a.vertices[h].x;var p=a.vertices[h].y;a=a.
|
|
|
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.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.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
|
|
|
k=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,g,l))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),n=Math.sin(k),k=0,r=a.length;k<r;k++){var p=a[k],s=new THREE.Vector3;s.x=l*p.x-n*p.y;s.y=n*p.x+l*p.y;s.z=p.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,r=a.length-1;k<r;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,p=g*f,s=k*e,u=p+f,q=s+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(p,
|
|
|
-s),new THREE.Vector2(u,s),new THREE.Vector2(p,q)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(u,s),new THREE.Vector2(u,q),new THREE.Vector2(p,q)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),r=0,p=0,s=0;s<h;s++)for(var u=s*l-f,q=0;q<g;q++)b[r]=q*k-e,b[r+1]=-u,a[r+2]=1,n[p]=q/c,n[p+1]=1-s/d,r+=3,p+=2;r=0;e=new Uint16Array(c*d*6);for(s=0;s<d;s++)for(q=0;q<c;q++)f=q+g*(s+1),h=q+1+g*(s+1),k=q+1+g*s,e[r]=q+g*s,e[r+
|
|
|
-1]=f,e[r+2]=k,e[r+3]=f,e[r+4]=h,e[r+5]=k,r+=6;this.attributes.index={array:e,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:a,itemSize:3};this.attributes.uv={array:n,itemSize:2}};THREE.PlaneGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(3,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<=d;a++){for(g=0;g<=c;g++){var n=new THREE.Vector3,r=e+g/c*f;n.x=k*Math.cos(r);n.y=k*Math.sin(r);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*c,g=0;g<=c;g++)r=g+e,f=r+a,l=r+c+a,n=r+c+1+a,this.faces.push(new THREE.Face3(f,
|
|
|
+s),new THREE.Vector2(u,s),new THREE.Vector2(p,q)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(u,s),new THREE.Vector2(u,q),new THREE.Vector2(p,q)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),r=0,p=0,s=0;s<h;s++)for(var u=s*l-f,q=0;q<g;q++)b[r]=q*k-e,b[r+1]=-u,a[r+2]=1,n[p]=q/c,n[p+1]=1-s/d,r+=3,p+=2;r=0;e=new Uint16Array(c*d*6);for(s=0;s<d;s++)for(q=0;q<c;q++)f=q+g*(s+1),h=q+1+g*(s+1),k=q+1+g*s,e[r]=q+g*s,e[r+1]=f,e[r+2]=k,e[r+3]=f,e[r+4]=
|
|
|
+h,e[r+5]=k,r+=6;THREE.IndexedGeometry2.call(this,e,b,a,n)};THREE.PlaneGeometry.prototype=Object.create(THREE.IndexedGeometry2.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(3,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<=d;a++){for(g=0;g<=c;g++){var n=new THREE.Vector3,r=e+g/c*f;n.x=k*Math.cos(r);n.y=k*Math.sin(r);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*c,g=0;g<=c;g++)r=g+e,f=r+a,l=r+c+a,n=r+c+1+a,this.faces.push(new THREE.Face3(f,
|
|
|
l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=r+a,l=r+c+1+a,n=r+1+a,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var r=[],p=[];for(h=0;h<=b;h++){var s=h/b,u=k/c,q=new THREE.Vector3;q.x=-a*Math.cos(d+s*e)*Math.sin(f+u*g);q.y=a*Math.cos(f+u*g);q.z=
|
|
|
a*Math.sin(d+s*e)*Math.sin(f+u*g);this.vertices.push(q);r.push(this.vertices.length-1);p.push(new THREE.Vector2(s,1-u))}l.push(r);n.push(p)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var r=this.vertices[d].clone().normalize(),p=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),u=this.vertices[g].clone().normalize(),q=n[k][h+1].clone(),w=n[k][h].clone(),v=n[k+1][h].clone(),t=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(q.x=(q.x+
|
|
|
w.x)/2,this.faces.push(new THREE.Face3(d,f,g,[r,s,u])),this.faceVertexUvs[0].push([q,v,t])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+t.x)/2,this.faces.push(new THREE.Face3(d,e,f,[r,p,s])),this.faceVertexUvs[0].push([q,w,v])):(this.faces.push(new THREE.Face3(d,e,g,[r,p,u])),this.faceVertexUvs[0].push([q,w,t]),this.faces.push(new THREE.Face3(e,f,g,[p.clone(),s,u.clone()])),this.faceVertexUvs[0].push([w.clone(),v,t.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
|