瀏覽代碼

Updated builds.

Mr.doob 7 年之前
父節點
當前提交
5f1abcc57e
共有 3 個文件被更改,包括 45 次插入49 次删除
  1. 17 19
      build/three.js
  2. 11 11
      build/three.min.js
  3. 17 19
      build/three.module.js

+ 17 - 19
build/three.js

@@ -10930,7 +10930,7 @@
 
 			//
 
-			if ( faces.length === 0 ) {
+			if ( vertices.length > 0 && faces.length === 0 ) {
 
 				console.error( 'THREE.DirectGeometry: Faceless geometries are not supported.' );
 
@@ -22664,7 +22664,8 @@
 
 		var animation = new WebGLAnimation();
 		animation.setAnimationLoop( onAnimationFrame );
-		animation.setContext( window );
+
+		if ( typeof window !== 'undefined' ) animation.setContext( window );
 
 		this.setAnimationLoop = function ( callback ) {
 
@@ -28957,7 +28958,7 @@
 
 		}
 
-		var shapes = font.generateShapes( text, parameters.size, parameters.curveSegments );
+		var shapes = font.generateShapes( text, parameters.size );
 
 		// translate parameters to ExtrudeGeometry API
 
@@ -30239,7 +30240,7 @@
 
 
 
-	var Geometries = /*#__PURE__*/Object.freeze({
+	var Geometries = Object.freeze({
 		WireframeGeometry: WireframeGeometry,
 		ParametricGeometry: ParametricGeometry,
 		ParametricBufferGeometry: ParametricBufferGeometry,
@@ -31009,7 +31010,7 @@
 
 
 
-	var Materials = /*#__PURE__*/Object.freeze({
+	var Materials = Object.freeze({
 		ShadowMaterial: ShadowMaterial,
 		SpriteMaterial: SpriteMaterial,
 		RawShaderMaterial: RawShaderMaterial,
@@ -31688,7 +31689,6 @@
 	 * @author mrdoob / http://mrdoob.com/
 	 */
 
-
 	function ImageLoader( manager ) {
 
 		this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
@@ -31791,7 +31791,6 @@
 	 * @author mrdoob / http://mrdoob.com/
 	 */
 
-
 	function CubeTextureLoader( manager ) {
 
 		this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
@@ -31862,7 +31861,6 @@
 	 * @author mrdoob / http://mrdoob.com/
 	 */
 
-
 	function TextureLoader( manager ) {
 
 		this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
@@ -32583,7 +32581,9 @@
 	//
 
 	var tmp = new Vector3();
-	var px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();
+	var px = new CubicPoly();
+	var py = new CubicPoly();
+	var pz = new CubicPoly();
 
 	function CatmullRomCurve3( points, closed, curveType, tension ) {
 
@@ -33368,7 +33368,7 @@
 
 
 
-	var Curves = /*#__PURE__*/Object.freeze({
+	var Curves = Object.freeze({
 		ArcCurve: ArcCurve,
 		CatmullRomCurve3: CatmullRomCurve3,
 		CubicBezierCurve: CubicBezierCurve,
@@ -38146,7 +38146,6 @@
 	 * @author thespite / http://clicktorelease.com/
 	 */
 
-
 	function ImageBitmapLoader( manager ) {
 
 		if ( typeof createImageBitmap === 'undefined' ) {
@@ -38532,7 +38531,6 @@
 	 * @author mrdoob / http://mrdoob.com/
 	 */
 
-
 	function Font( data ) {
 
 		this.type = 'Font';
@@ -38545,13 +38543,12 @@
 
 		isFont: true,
 
-		generateShapes: function ( text, size, divisions ) {
+		generateShapes: function ( text, size ) {
 
 			if ( size === undefined ) size = 100;
-			if ( divisions === undefined ) divisions = 4;
 
 			var shapes = [];
-			var paths = createPaths( text, size, divisions, this.data );
+			var paths = createPaths( text, size, this.data );
 
 			for ( var p = 0, pl = paths.length; p < pl; p ++ ) {
 
@@ -38565,7 +38562,7 @@
 
 	} );
 
-	function createPaths( text, size, divisions, data ) {
+	function createPaths( text, size, data ) {
 
 		var chars = Array.from ? Array.from( text ) : String( text ).split( '' ); // see #13988
 		var scale = size / data.resolution;
@@ -38586,7 +38583,7 @@
 
 			} else {
 
-				var ret = createPath( char, divisions, scale, offsetX, offsetY, data );
+				var ret = createPath( char, scale, offsetX, offsetY, data );
 				offsetX += ret.offsetX;
 				paths.push( ret.path );
 
@@ -38598,7 +38595,7 @@
 
 	}
 
-	function createPath( char, divisions, scale, offsetX, offsetY, data ) {
+	function createPath( char, scale, offsetX, offsetY, data ) {
 
 		var glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
 
@@ -44574,7 +44571,8 @@
 	 *  headWidth - Number
 	 */
 
-	var lineGeometry, coneGeometry;
+	var lineGeometry;
+	var coneGeometry;
 
 	function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
 

+ 11 - 11
build/three.min.js

@@ -187,9 +187,9 @@ else{Z.initAttributes();l=c.attributes;h=h.getAttributes();var r=d.defaultAttrib
 D.bindBuffer(D.ARRAY_BUFFER,z);D.vertexAttribPointer(k,u,w,t,H*p,q*p)}else q.isInstancedBufferAttribute?(Z.enableAttributeAndDivisor(k,q.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=q.meshPerAttribute*q.count)):Z.enableAttribute(k),D.bindBuffer(D.ARRAY_BUFFER,z),D.vertexAttribPointer(k,u,w,t,0,0)}}else if(void 0!==r&&(t=r[C],void 0!==t))switch(t.length){case 2:D.vertexAttrib2fv(k,t);break;case 3:D.vertexAttrib3fv(k,t);break;case 4:D.vertexAttrib4fv(k,t);break;default:D.vertexAttrib1fv(k,
 t)}}}Z.disableUnusedAttributes()}null!==g&&D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,v.buffer)}v=Infinity;null!==g?v=g.count:void 0!==m&&(v=m.count);g=c.drawRange.start*b;m=null!==f?f.start*b:0;var C=Math.max(g,m);f=Math.max(0,Math.min(v,g+c.drawRange.count*b,m+(null!==f?f.count*b:Infinity))-1-C+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)Z.setLineWidth(d.wireframeLinewidth*(null===G?Y:1)),a.setMode(D.LINES);else switch(e.drawMode){case 0:a.setMode(D.TRIANGLES);break;case 1:a.setMode(D.TRIANGLE_STRIP);
 break;case 2:a.setMode(D.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),Z.setLineWidth(d*(null===G?Y:1)),e.isLineSegments?a.setMode(D.LINES):e.isLineLoop?a.setMode(D.LINE_LOOP):a.setMode(D.LINE_STRIP)):e.isPoints&&a.setMode(D.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,C,f):a.render(C,f)}};this.compile=function(a,b){y=pa.get(a,b);y.init();a.traverse(function(a){a.isLight&&(y.pushLight(a),a.castShadow&&y.pushShadow(a))});y.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=
-0;c<b.material.length;c++)v(b.material[c],a.fog,b);else v(b.material,a.fog,b)})};var xa=null,ua=new Td;ua.setAnimationLoop(function(){ka.isPresenting()||xa&&xa()});ua.setContext(window);this.setAnimationLoop=function(a){xa=a;ka.setAnimationLoop(a);ua.start()};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!B){O="";J=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();
-ka.enabled&&(b=ka.getCamera(b));y=pa.get(a,b);y.init();a.onBeforeRender(A,a,b,c);fa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ea.setFromMatrix(fa);qa=this.localClippingEnabled;ja=X.init(this.clippingPlanes,qa,b);E=ta.get(a,b);E.init();h(a,b,A.sortObjects);!0===A.sortObjects&&E.sort();ja&&X.beginShadows();Aa.render(y.state.shadowsArray,a,b);y.setupLights(b);ja&&X.endShadows();this.info.autoReset&&this.info.reset();void 0===c&&(c=null);this.setRenderTarget(c);ma.render(E,a,b,d);d=E.opaque;
-var e=E.transparent;if(a.overrideMaterial){var f=a.overrideMaterial;d.length&&l(d,a,b,f);e.length&&l(e,a,b,f)}else d.length&&l(d,a,b),e.length&&l(e,a,b);za.render(y.state.spritesArray,a,b);c&&hb.updateRenderTargetMipmap(c);Z.buffers.depth.setTest(!0);Z.buffers.depth.setMask(!0);Z.buffers.color.setMask(!0);Z.setPolygonOffset(!1);a.onAfterRender(A,a,b);ka.enabled&&ka.submitFrame();y=E=null}};this.allocTextureUnit=function(){var a=ca;a>=Ra.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+
+0;c<b.material.length;c++)v(b.material[c],a.fog,b);else v(b.material,a.fog,b)})};var xa=null,ua=new Td;ua.setAnimationLoop(function(){ka.isPresenting()||xa&&xa()});"undefined"!==typeof window&&ua.setContext(window);this.setAnimationLoop=function(a){xa=a;ka.setAnimationLoop(a);ua.start()};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!B){O="";J=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===
+b.parent&&b.updateMatrixWorld();ka.enabled&&(b=ka.getCamera(b));y=pa.get(a,b);y.init();a.onBeforeRender(A,a,b,c);fa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ea.setFromMatrix(fa);qa=this.localClippingEnabled;ja=X.init(this.clippingPlanes,qa,b);E=ta.get(a,b);E.init();h(a,b,A.sortObjects);!0===A.sortObjects&&E.sort();ja&&X.beginShadows();Aa.render(y.state.shadowsArray,a,b);y.setupLights(b);ja&&X.endShadows();this.info.autoReset&&this.info.reset();void 0===c&&(c=null);this.setRenderTarget(c);
+ma.render(E,a,b,d);d=E.opaque;var e=E.transparent;if(a.overrideMaterial){var f=a.overrideMaterial;d.length&&l(d,a,b,f);e.length&&l(e,a,b,f)}else d.length&&l(d,a,b),e.length&&l(e,a,b);za.render(y.state.spritesArray,a,b);c&&hb.updateRenderTargetMipmap(c);Z.buffers.depth.setTest(!0);Z.buffers.depth.setMask(!0);Z.buffers.color.setMask(!0);Z.setPolygonOffset(!1);a.onAfterRender(A,a,b);ka.enabled&&ka.submitFrame();y=E=null}};this.allocTextureUnit=function(){var a=ca;a>=Ra.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+
 a+" texture units while this GPU supports only "+Ra.maxTextures);ca+=1;return a};this.setTexture2D=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTarget&&(a||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);hb.setTexture2D(b,c)}}();this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),a=!0);hb.setTexture2D(b,
 c)}}();this.setTextureCube=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?hb.setTextureCube(b,c):hb.setTextureCubeDynamic(b,c)}}();this.setFramebuffer=function(a){I=a};this.getRenderTarget=function(){return G};this.setRenderTarget=function(a){(G=a)&&void 0===
 Ba.get(a).__webglFramebuffer&&hb.setupRenderTarget(a);var b=I,c=!1;a?(b=Ba.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube&&(b=b[a.activeCubeFace],c=!0),S.copy(a.viewport),T.copy(a.scissor),aa=a.scissorTest):(S.copy(ba).multiplyScalar(Y),T.copy(N).multiplyScalar(Y),aa=da);K!==b&&(D.bindFramebuffer(D.FRAMEBUFFER,b),K=b);Z.viewport(S);Z.scissor(T);Z.setScissorTest(aa);c&&(c=Ba.get(a.texture),D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,
@@ -239,9 +239,9 @@ g(P[N],P[U],P[R]);A.push(ba);ca=ca.concat(ba)}for(U=0;U<E;U++){da=U/E;var ea=V*M
 1;da<=w;da++)for(N=0;N<X;N++)fa=C?c(a[N],ca[N],R):a[N],F?(M.copy(I.normals[da]).multiplyScalar(fa.x),K.copy(I.binormals[da]).multiplyScalar(fa.y),J.copy(G[da]).add(M).add(K),l(J.x,J.y,J.z)):l(fa.x,fa.y,H/w*da);for(U=E-1;0<=U;U--){da=U/E;ea=V*Math.cos(da*Math.PI/2);R=Q*Math.sin(da*Math.PI/2);N=0;for(da=T.length;N<da;N++)fa=c(T[N],x[N],R),l(fa.x,fa.y,H+ea);S=0;for(O=L.length;S<O;S++)for(P=L[S],ba=A[S],N=0,da=P.length;N<da;N++)fa=c(P[N],ba[N],R),F?l(fa.x,fa.y+G[w-1].y,G[w-1].x+ea):l(fa.x,fa.y,H+ea)}(function(){var a=
 e.length/3;if(C){var b=0*X;for(N=0;N<aa;N++)Y=W[N],k(Y[2]+b,Y[1]+b,Y[0]+b);b=X*(w+2*E);for(N=0;N<aa;N++)Y=W[N],k(Y[0]+b,Y[1]+b,Y[2]+b)}else{for(N=0;N<aa;N++)Y=W[N],k(Y[2],Y[1],Y[0]);for(N=0;N<aa;N++)Y=W[N],k(Y[0]+X*w,Y[1]+X*w,Y[2]+X*w)}d.addGroup(a,e.length/3-a,0)})();(function(){var a=e.length/3,b=0;h(T,b);b+=T.length;S=0;for(O=L.length;S<O;S++)P=L[S],h(P,b),b+=P.length;d.addGroup(a,e.length/3-a,1)})()}G.call(this);this.type="ExtrudeBufferGeometry";this.parameters={shapes:a,options:b};a=Array.isArray(a)?
 a:[a];for(var d=this,e=[],f=[],g=0,h=a.length;g<h;g++)c(a[g]);this.addAttribute("position",new A(e,3));this.addAttribute("uv",new A(f,2));this.computeVertexNormals()}function gf(a,b,c){c.shapes=[];if(Array.isArray(a))for(var d=0,e=a.length;d<e;d++)c.shapes.push(a[d].uuid);else c.shapes.push(a.uuid);void 0!==b.extrudePath&&(c.options.extrudePath=b.extrudePath.toJSON());return c}function Wc(a,b){J.call(this);this.type="TextGeometry";this.parameters={text:a,parameters:b};this.fromBufferGeometry(new dc(a,
-b));this.mergeVertices()}function dc(a,b){b=b||{};var c=b.font;if(!c||!c.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new J;a=c.generateShapes(a,b.size,b.curveSegments);b.depth=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);Sa.call(this,a,b);this.type="TextBufferGeometry"}function Xc(a,b,c,d,e,f,g){J.call(this);this.type="SphereGeometry";
-this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};this.fromBufferGeometry(new xb(a,b,c,d,e,f,g));this.mergeVertices()}function xb(a,b,c,d,e,f,g){G.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||1;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=f+g,l,m,k=0,n=[],r=new p,q=new p,t=[],u=[],z=[],x=[];for(m=0;m<=c;m++){var w=[],H=m/c;for(l=0;l<=b;l++){var C=l/b;r.x=-a*Math.cos(d+C*e)*Math.sin(f+H*g);r.y=a*Math.cos(f+H*g);r.z=a*Math.sin(d+C*e)*Math.sin(f+H*g);u.push(r.x,r.y,r.z);q.set(r.x,r.y,r.z).normalize();z.push(q.x,q.y,q.z);x.push(C,1-H);w.push(k++)}n.push(w)}for(m=0;m<c;m++)for(l=0;l<b;l++)a=n[m][l+1],d=n[m][l],e=n[m+1][l],g=n[m+1][l+1],(0!==m||0<f)&&t.push(a,d,g),(m!==c-1||h<Math.PI)&&t.push(d,e,g);this.setIndex(t);this.addAttribute("position",
+b));this.mergeVertices()}function dc(a,b){b=b||{};var c=b.font;if(!c||!c.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new J;a=c.generateShapes(a,b.size);b.depth=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);Sa.call(this,a,b);this.type="TextBufferGeometry"}function Xc(a,b,c,d,e,f,g){J.call(this);this.type="SphereGeometry";this.parameters=
+{radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};this.fromBufferGeometry(new xb(a,b,c,d,e,f,g));this.mergeVertices()}function xb(a,b,c,d,e,f,g){G.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||1;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=
+f+g,l,m,k=0,n=[],r=new p,q=new p,t=[],u=[],z=[],x=[];for(m=0;m<=c;m++){var w=[],H=m/c;for(l=0;l<=b;l++){var C=l/b;r.x=-a*Math.cos(d+C*e)*Math.sin(f+H*g);r.y=a*Math.cos(f+H*g);r.z=a*Math.sin(d+C*e)*Math.sin(f+H*g);u.push(r.x,r.y,r.z);q.set(r.x,r.y,r.z).normalize();z.push(q.x,q.y,q.z);x.push(C,1-H);w.push(k++)}n.push(w)}for(m=0;m<c;m++)for(l=0;l<b;l++)a=n[m][l+1],d=n[m][l],e=n[m+1][l],g=n[m+1][l+1],(0!==m||0<f)&&t.push(a,d,g),(m!==c-1||h<Math.PI)&&t.push(d,e,g);this.setIndex(t);this.addAttribute("position",
 new A(u,3));this.addAttribute("normal",new A(z,3));this.addAttribute("uv",new A(x,2))}function Yc(a,b,c,d,e,f){J.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};this.fromBufferGeometry(new ec(a,b,c,d,e,f));this.mergeVertices()}function ec(a,b,c,d,e,f){G.call(this);this.type="RingBufferGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||.5;b=b||
 1;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(1,d):1;var g=[],h=[],l=[],m=[],k=a,n=(b-a)/d,r=new p,q=new y,t,u;for(t=0;t<=d;t++){for(u=0;u<=c;u++)a=e+u/c*f,r.x=k*Math.cos(a),r.y=k*Math.sin(a),h.push(r.x,r.y,r.z),l.push(0,0,1),q.x=(r.x/b+1)/2,q.y=(r.y/b+1)/2,m.push(q.x,q.y);k+=n}for(t=0;t<d;t++)for(b=t*(c+1),u=0;u<c;u++)a=u+b,e=a+c+1,f=a+c+2,k=a+1,g.push(a,e,k),g.push(e,f,k);this.setIndex(g);this.addAttribute("position",new A(h,3));this.addAttribute("normal",
 new A(l,3));this.addAttribute("uv",new A(m,2))}function Zc(a,b,c,d){J.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};this.fromBufferGeometry(new fc(a,b,c,d));this.mergeVertices()}function fc(a,b,c,d){G.call(this);this.type="LatheBufferGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=Math.floor(b)||12;c=c||0;d=d||2*Math.PI;d=P.clamp(d,0,2*Math.PI);var e=[],f=[],g=[],h=1/b,l=new p,m=new y,k;for(k=0;k<=b;k++){var n=c+k*h*d;var r=
@@ -543,10 +543,10 @@ this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn("THR
 getZ:function(a){return this.array[a*this.itemSize+2]},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},getW:function(a){return this.array[a*this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+
 1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},onUpload:function(a){this.onUploadCallback=a;return this},clone:function(){return(new this.constructor(this.array,this.itemSize)).copy(this)}});vc.prototype=Object.create(O.prototype);vc.prototype.constructor=vc;wc.prototype=Object.create(O.prototype);wc.prototype.constructor=wc;xc.prototype=Object.create(O.prototype);xc.prototype.constructor=xc;yc.prototype=Object.create(O.prototype);yc.prototype.constructor=yc;nb.prototype=Object.create(O.prototype);
 nb.prototype.constructor=nb;zc.prototype=Object.create(O.prototype);zc.prototype.constructor=zc;ob.prototype=Object.create(O.prototype);ob.prototype.constructor=ob;A.prototype=Object.create(O.prototype);A.prototype.constructor=A;Ac.prototype=Object.create(O.prototype);Ac.prototype.constructor=Ac;Object.assign(Ee.prototype,{computeGroups:function(a){var b=[],c=void 0;a=a.faces;for(var d=0;d<a.length;d++){var e=a[d];if(e.materialIndex!==c){c=e.materialIndex;void 0!==f&&(f.count=3*d-f.start,b.push(f));
-var f={start:3*d,materialIndex:c}}}void 0!==f&&(f.count=3*d-f.start,b.push(f));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){var l=[];for(var m=0;m<h;m++)l[m]=[];this.morphTargets.position=l}var k=a.morphNormals,n=k.length;if(0<n){var p=[];for(m=0;m<n;m++)p[m]=[];this.morphTargets.normal=p}var q=a.skinIndices,t=a.skinWeights,u=q.length===c.length,z=t.length===c.length;0===b.length&&
-console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(m=0;m<b.length;m++){var x=b[m];this.vertices.push(c[x.a],c[x.b],c[x.c]);var w=x.vertexNormals;3===w.length?this.normals.push(w[0],w[1],w[2]):(w=x.normal,this.normals.push(w,w,w));w=x.vertexColors;3===w.length?this.colors.push(w[0],w[1],w[2]):(w=x.color,this.colors.push(w,w,w));!0===e&&(w=d[0][m],void 0!==w?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",m),this.uvs.push(new y,
-new y,new y)));!0===f&&(w=d[1][m],void 0!==w?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",m),this.uvs2.push(new y,new y,new y)));for(w=0;w<h;w++){var A=g[w].vertices;l[w].push(A[x.a],A[x.b],A[x.c])}for(w=0;w<n;w++)A=k[w].vertexNormals[m],p[w].push(A.a,A.b,A.c);u&&this.skinIndices.push(q[x.a],q[x.b],q[x.c]);z&&this.skinWeights.push(t[x.a],t[x.b],t[x.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=
-a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var Hf=1;G.prototype=Object.assign(Object.create(ha.prototype),{constructor:G,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){Array.isArray(a)?this.index=new (65535<Fe(a)?ob:nb)(a,1):this.index=a},addAttribute:function(a,b,c){if(!(b&&b.isBufferAttribute||b&&b.isInterleavedBufferAttribute))return console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
+var f={start:3*d,materialIndex:c}}}void 0!==f&&(f.count=3*d-f.start,b.push(f));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){var l=[];for(var m=0;m<h;m++)l[m]=[];this.morphTargets.position=l}var k=a.morphNormals,n=k.length;if(0<n){var p=[];for(m=0;m<n;m++)p[m]=[];this.morphTargets.normal=p}var q=a.skinIndices,t=a.skinWeights,u=q.length===c.length,z=t.length===c.length;0<c.length&&
+0===b.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(m=0;m<b.length;m++){var x=b[m];this.vertices.push(c[x.a],c[x.b],c[x.c]);var w=x.vertexNormals;3===w.length?this.normals.push(w[0],w[1],w[2]):(w=x.normal,this.normals.push(w,w,w));w=x.vertexColors;3===w.length?this.colors.push(w[0],w[1],w[2]):(w=x.color,this.colors.push(w,w,w));!0===e&&(w=d[0][m],void 0!==w?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
+m),this.uvs.push(new y,new y,new y)));!0===f&&(w=d[1][m],void 0!==w?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",m),this.uvs2.push(new y,new y,new y)));for(w=0;w<h;w++){var A=g[w].vertices;l[w].push(A[x.a],A[x.b],A[x.c])}for(w=0;w<n;w++)A=k[w].vertexNormals[m],p[w].push(A.a,A.b,A.c);u&&this.skinIndices.push(q[x.a],q[x.b],q[x.c]);z&&this.skinWeights.push(t[x.a],t[x.b],t[x.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;
+this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var Hf=1;G.prototype=Object.assign(Object.create(ha.prototype),{constructor:G,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){Array.isArray(a)?this.index=new (65535<Fe(a)?ob:nb)(a,1):this.index=a},addAttribute:function(a,b,c){if(!(b&&b.isBufferAttribute||b&&b.isInterleavedBufferAttribute))return console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
 this.addAttribute(a,new O(b,c));if("index"===a)return console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(b),this;this.attributes[a]=b;return this},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a];return this},addGroup:function(a,b,c){this.groups.push({start:a,count:b,materialIndex:void 0!==c?c:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,b){this.drawRange.start=a;this.drawRange.count=
 b},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToBufferAttribute(b),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new ta).getNormalMatrix(a).applyToBufferAttribute(b),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a=new F;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new F;return function(b){a.makeRotationY(b);
 this.applyMatrix(a);return this}}(),rotateZ:function(){var a=new F;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new F;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new F;return function(b,c,d){a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new B;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){var a=new p;
@@ -774,7 +774,7 @@ a;return this},load:function(a,b,c,d){void 0===a&&(a="");void 0!==this.path&&(a=
 setPath:function(a){this.path=a;return this}};Object.assign(je.prototype,{moveTo:function(a,b){this.currentPath=new Pa;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,b)},lineTo:function(a,b){this.currentPath.lineTo(a,b)},quadraticCurveTo:function(a,b,c,d){this.currentPath.quadraticCurveTo(a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this.currentPath.bezierCurveTo(a,b,c,d,e,f)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,b){function c(a){for(var b=[],
 c=0,d=a.length;c<d;c++){var e=a[c],f=new jb;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],l=h.x-g.x,k=h.y-g.y;if(Math.abs(k)>Number.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=Za.isClockWise,f=this.subPaths;if(0===f.length)return[];
 if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new jb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],p=[],n=0;k[n]=void 0;p[n]=[];for(var r=0,q=f.length;r<q;r++){g=f[r];var t=g.getPoints();var u=e(t);(u=a?!u:u)?(!l&&k[n]&&n++,k[n]={s:new jb,p:t},k[n].s.curves=g.curves,l&&n++,p[n]=[]):p[n].push({h:g,p:t[0]})}if(!k[0])return c(f);if(1<k.length){r=!1;a=[];e=0;for(f=k.length;e<f;e++)h[e]=[];e=0;for(f=k.length;e<f;e++)for(g=p[e],u=0;u<g.length;u++){l=
-g[u];n=!0;for(t=0;t<k.length;t++)d(l.p,k[t].p)&&(e!==t&&a.push({froms:e,tos:t,hole:u}),n?(n=!1,h[t].push(l)):r=!0);n&&h[e].push(l)}0<a.length&&(r||(p=h))}r=0;for(e=k.length;r<e;r++)for(h=k[r].s,b.push(h),a=p[r],f=0,g=a.length;f<g;f++)h.holes.push(a[f].h);return b}});Object.assign(ke.prototype,{isFont:!0,generateShapes:function(a,b,c){void 0===b&&(b=100);c=[];var d=b;b=this.data;var e=Array.from?Array.from(a):String(a).split("");d/=b.resolution;var f=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*
+g[u];n=!0;for(t=0;t<k.length;t++)d(l.p,k[t].p)&&(e!==t&&a.push({froms:e,tos:t,hole:u}),n?(n=!1,h[t].push(l)):r=!0);n&&h[e].push(l)}0<a.length&&(r||(p=h))}r=0;for(e=k.length;r<e;r++)for(h=k[r].s,b.push(h),a=p[r],f=0,g=a.length;f<g;f++)h.holes.push(a[f].h);return b}});Object.assign(ke.prototype,{isFont:!0,generateShapes:function(a,b){void 0===b&&(b=100);var c=[],d=b;b=this.data;var e=Array.from?Array.from(a):String(a).split("");d/=b.resolution;var f=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*
 d;a=[];for(var g=0,h=0,l=0;l<e.length;l++){var k=e[l];if("\n"===k)g=0,h-=f;else{var p=d;var n=g,r=h;if(k=b.glyphs[k]||b.glyphs["?"]){var q=new je;if(k.o)for(var t=k._cachedOutline||(k._cachedOutline=k.o.split(" ")),u=0,y=t.length;u<y;)switch(t[u++]){case "m":var x=t[u++]*p+n;var w=t[u++]*p+r;q.moveTo(x,w);break;case "l":x=t[u++]*p+n;w=t[u++]*p+r;q.lineTo(x,w);break;case "q":var A=t[u++]*p+n;var C=t[u++]*p+r;var B=t[u++]*p+n;var F=t[u++]*p+r;q.quadraticCurveTo(B,F,A,C);break;case "b":A=t[u++]*p+n,
 C=t[u++]*p+r,B=t[u++]*p+n,F=t[u++]*p+r,x=t[u++]*p+n,w=t[u++]*p+r,q.bezierCurveTo(B,F,x,w,A,C)}p={offsetX:k.ha*p,path:q}}else p=void 0;g+=p.offsetX;a.push(p.path)}}b=0;for(e=a.length;b<e;b++)Array.prototype.push.apply(c,a[b].toShapes());return c}});Object.assign(mf.prototype,{load:function(a,b,c,d){var e=this,f=new Ka(this.manager);f.setPath(this.path);f.load(a,function(a){try{var c=JSON.parse(a)}catch(l){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),
 c=JSON.parse(a.substring(65,a.length-2))}a=e.parse(c);b&&b(a)},c,d)},parse:function(a){return new ke(a)},setPath:function(a){this.path=a;return this}});var Sd,ne={getContext:function(){void 0===Sd&&(Sd=new (window.AudioContext||window.webkitAudioContext));return Sd},setContext:function(a){Sd=a}};Object.assign(le.prototype,{load:function(a,b,c,d){var e=new Ka(this.manager);e.setResponseType("arraybuffer");e.load(a,function(a){ne.getContext().decodeAudioData(a,function(a){b(a)})},c,d)}});Object.assign(nf.prototype,

+ 17 - 19
build/three.module.js

@@ -10924,7 +10924,7 @@ Object.assign( DirectGeometry.prototype, {
 
 		//
 
-		if ( faces.length === 0 ) {
+		if ( vertices.length > 0 && faces.length === 0 ) {
 
 			console.error( 'THREE.DirectGeometry: Faceless geometries are not supported.' );
 
@@ -22658,7 +22658,8 @@ function WebGLRenderer( parameters ) {
 
 	var animation = new WebGLAnimation();
 	animation.setAnimationLoop( onAnimationFrame );
-	animation.setContext( window );
+
+	if ( typeof window !== 'undefined' ) animation.setContext( window );
 
 	this.setAnimationLoop = function ( callback ) {
 
@@ -28951,7 +28952,7 @@ function TextBufferGeometry( text, parameters ) {
 
 	}
 
-	var shapes = font.generateShapes( text, parameters.size, parameters.curveSegments );
+	var shapes = font.generateShapes( text, parameters.size );
 
 	// translate parameters to ExtrudeGeometry API
 
@@ -30233,7 +30234,7 @@ CircleBufferGeometry.prototype.constructor = CircleBufferGeometry;
 
 
 
-var Geometries = /*#__PURE__*/Object.freeze({
+var Geometries = Object.freeze({
 	WireframeGeometry: WireframeGeometry,
 	ParametricGeometry: ParametricGeometry,
 	ParametricBufferGeometry: ParametricBufferGeometry,
@@ -31003,7 +31004,7 @@ LineDashedMaterial.prototype.copy = function ( source ) {
 
 
 
-var Materials = /*#__PURE__*/Object.freeze({
+var Materials = Object.freeze({
 	ShadowMaterial: ShadowMaterial,
 	SpriteMaterial: SpriteMaterial,
 	RawShaderMaterial: RawShaderMaterial,
@@ -31682,7 +31683,6 @@ Object.assign( DataTextureLoader.prototype, {
  * @author mrdoob / http://mrdoob.com/
  */
 
-
 function ImageLoader( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
@@ -31785,7 +31785,6 @@ Object.assign( ImageLoader.prototype, {
  * @author mrdoob / http://mrdoob.com/
  */
 
-
 function CubeTextureLoader( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
@@ -31856,7 +31855,6 @@ Object.assign( CubeTextureLoader.prototype, {
  * @author mrdoob / http://mrdoob.com/
  */
 
-
 function TextureLoader( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
@@ -32577,7 +32575,9 @@ function CubicPoly() {
 //
 
 var tmp = new Vector3();
-var px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();
+var px = new CubicPoly();
+var py = new CubicPoly();
+var pz = new CubicPoly();
 
 function CatmullRomCurve3( points, closed, curveType, tension ) {
 
@@ -33362,7 +33362,7 @@ SplineCurve.prototype.fromJSON = function ( json ) {
 
 
 
-var Curves = /*#__PURE__*/Object.freeze({
+var Curves = Object.freeze({
 	ArcCurve: ArcCurve,
 	CatmullRomCurve3: CatmullRomCurve3,
 	CubicBezierCurve: CubicBezierCurve,
@@ -38140,7 +38140,6 @@ var TEXTURE_FILTER = {
  * @author thespite / http://clicktorelease.com/
  */
 
-
 function ImageBitmapLoader( manager ) {
 
 	if ( typeof createImageBitmap === 'undefined' ) {
@@ -38526,7 +38525,6 @@ Object.assign( ShapePath.prototype, {
  * @author mrdoob / http://mrdoob.com/
  */
 
-
 function Font( data ) {
 
 	this.type = 'Font';
@@ -38539,13 +38537,12 @@ Object.assign( Font.prototype, {
 
 	isFont: true,
 
-	generateShapes: function ( text, size, divisions ) {
+	generateShapes: function ( text, size ) {
 
 		if ( size === undefined ) size = 100;
-		if ( divisions === undefined ) divisions = 4;
 
 		var shapes = [];
-		var paths = createPaths( text, size, divisions, this.data );
+		var paths = createPaths( text, size, this.data );
 
 		for ( var p = 0, pl = paths.length; p < pl; p ++ ) {
 
@@ -38559,7 +38556,7 @@ Object.assign( Font.prototype, {
 
 } );
 
-function createPaths( text, size, divisions, data ) {
+function createPaths( text, size, data ) {
 
 	var chars = Array.from ? Array.from( text ) : String( text ).split( '' ); // see #13988
 	var scale = size / data.resolution;
@@ -38580,7 +38577,7 @@ function createPaths( text, size, divisions, data ) {
 
 		} else {
 
-			var ret = createPath( char, divisions, scale, offsetX, offsetY, data );
+			var ret = createPath( char, scale, offsetX, offsetY, data );
 			offsetX += ret.offsetX;
 			paths.push( ret.path );
 
@@ -38592,7 +38589,7 @@ function createPaths( text, size, divisions, data ) {
 
 }
 
-function createPath( char, divisions, scale, offsetX, offsetY, data ) {
+function createPath( char, scale, offsetX, offsetY, data ) {
 
 	var glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
 
@@ -44568,7 +44565,8 @@ PlaneHelper.prototype.updateMatrixWorld = function ( force ) {
  *  headWidth - Number
  */
 
-var lineGeometry, coneGeometry;
+var lineGeometry;
+var coneGeometry;
 
 function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {