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

Updated builds.

上级 23d6cc56
......@@ -34229,7 +34229,7 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p
}
this.setIndex( new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) );
this.setIndex( new ( positions.count > 65535 ? THREE.Uint32Attribute : THREE.Uint16Attribute )( indices, 1 ) );
this.addAttribute( 'position', positions );
this.addAttribute( 'normal', normals );
this.addAttribute( 'uv', uvs );
......
......@@ -811,8 +811,8 @@ THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingG
THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};this.fromBufferGeometry(new THREE.SphereBufferGeometry(a,b,c,d,e,g,f))};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
THREE.SphereGeometry.prototype.clone=function(){return new THREE.SphereGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength)};
THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,l=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*l),3),n=new THREE.BufferAttribute(new Float32Array(3*
l),3),l=new THREE.BufferAttribute(new Float32Array(2*l),2),p=0,m=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],v=s/c,x=0;x<=b;x++){var u=x/b,B=-a*Math.cos(d+u*e)*Math.sin(g+v*f),w=a*Math.cos(g+v*f),C=a*Math.sin(d+u*e)*Math.sin(g+v*f);q.set(B,w,C).normalize();k.setXYZ(p,B,w,C);n.setXYZ(p,q.x,q.y,q.z);l.setXY(p,u,1-v);t.push(p);p++}m.push(t)}d=[];for(s=0;s<c;s++)for(x=0;x<b;x++)e=m[s][x+1],f=m[s][x],p=m[s+1][x],q=m[s+1][x+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.setIndex(new THREE.BufferAttribute(new Uint16Array(d),
1));this.addAttribute("position",k);this.addAttribute("normal",n);this.addAttribute("uv",l);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
l),3),l=new THREE.BufferAttribute(new Float32Array(2*l),2),p=0,m=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],v=s/c,x=0;x<=b;x++){var u=x/b,B=-a*Math.cos(d+u*e)*Math.sin(g+v*f),w=a*Math.cos(g+v*f),C=a*Math.sin(d+u*e)*Math.sin(g+v*f);q.set(B,w,C).normalize();k.setXYZ(p,B,w,C);n.setXYZ(p,q.x,q.y,q.z);l.setXY(p,u,1-v);t.push(p);p++}m.push(t)}d=[];for(s=0;s<c;s++)for(x=0;x<b;x++)e=m[s][x+1],f=m[s][x],p=m[s+1][x],q=m[s+1][x+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.setIndex(new (65535<
k.count?THREE.Uint32Attribute:THREE.Uint16Attribute)(d,1));this.addAttribute("position",k);this.addAttribute("normal",n);this.addAttribute("uv",l);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
THREE.SphereBufferGeometry.prototype.clone=function(){var a=new THREE.SphereBufferGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var g=new THREE.Vector3,f=[],h=[],l=0;l<=c;l++)for(var k=0;k<=d;k++){var n=k/d*e,p=l/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);f.push(new THREE.Vector2(k/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册