Przeglądaj źródła

Updated builds.

Mr.doob 8 lat temu
rodzic
commit
abd3ec6e28
3 zmienionych plików z 19 dodań i 35 usunięć
  1. 3 11
      build/three.js
  2. 13 13
      build/three.min.js
  3. 3 11
      build/three.module.js

+ 3 - 11
build/three.js

@@ -12297,21 +12297,13 @@
 
 	function arrayMax( array ) {
 
-		if ( array.length === 0 ) {
-
-			return - Infinity;
-
-		}
+		if ( array.length === 0 ) return - Infinity;
 
 		var max = array[ 0 ];
 
-		for ( var i = 1; i < array.length; ++ i ) {
+		for ( var i = 1, l = array.length; i < l; ++ i ) {
 
-			if ( array[ i ] > max ) {
-
-				max = array[ i ];
-
-			}
+			if ( array[ i ] > max ) max = array[ i ];
 
 		}
 

+ 13 - 13
build/three.min.js

@@ -46,19 +46,19 @@ function(){};this.onAfterRender=function(){}}function Eb(a,b){this.start=void 0!
 this.color=new K(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=this.morphTargets=this.skinning=!1;this.setValues(a)}function Y(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
 this.uuid=X.generateUUID();this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.onUploadCallback=function(){};this.version=0}function pc(a,b){Y.call(this,new Int8Array(a),b)}function qc(a,b){Y.call(this,new Uint8Array(a),b)}function rc(a,b){Y.call(this,new Uint8ClampedArray(a),b)}function sc(a,b){Y.call(this,new Int16Array(a),b)}function hb(a,b){Y.call(this,new Uint16Array(a),b)}function tc(a,b){Y.call(this,
 new Int32Array(a),b)}function ib(a,b){Y.call(this,new Uint32Array(a),b)}function E(a,b){Y.call(this,new Float32Array(a),b)}function uc(a,b){Y.call(this,new Float64Array(a),b)}function Je(){this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=
-!1}function Pd(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1;c<a.length;++c)a[c]>b&&(b=a[c]);return b}function P(){Object.defineProperty(this,"id",{value:Qd++});this.uuid=X.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=
-this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function H(){Object.defineProperty(this,"id",{value:Qd++});this.uuid=X.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}}function wa(a,b){B.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new H;this.material=void 0!==b?b:new Ha({color:16777215*
-Math.random()});this.drawMode=0;this.updateMorphTargets()}function Fb(a,b,c,d,e,f){P.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new jb(a,b,c,d,e,f));this.mergeVertices()}function jb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,l,C,F,G){var Z=f/C,aa=g/F,ua=f/2,I=g/2,D=l/2;g=C+1;var E=F+1,B=f=0,Q,O,W=new p;for(O=0;O<E;O++){var ka=O*aa-I;for(Q=0;Q<g;Q++)W[a]=(Q*Z-ua)*d,W[b]=ka*e,W[c]=D,m.push(W.x,W.y,
-W.z),W[a]=0,W[b]=0,W[c]=0<l?1:-1,r.push(W.x,W.y,W.z),q.push(Q/C),q.push(1-O/F),f+=1}for(O=0;O<F;O++)for(Q=0;Q<C;Q++)a=n+Q+g*(O+1),b=n+(Q+1)+g*(O+1),c=n+(Q+1)+g*O,k.push(n+Q+g*O,a,c),k.push(a,b,c),B+=6;h.addGroup(u,B,G);u+=B;n+=f}H.call(this);this.type="BoxBufferGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};var h=this;d=Math.floor(d)||1;e=Math.floor(e)||1;f=Math.floor(f)||1;var k=[],m=[],r=[],q=[],n=0,u=0;g("z","y","x",-1,-1,c,b,a,f,e,0);g("z",
-"y","x",1,-1,c,b,-a,f,e,1);g("x","z","y",1,1,a,c,b,d,f,2);g("x","z","y",1,-1,a,c,-b,d,f,3);g("x","y","z",1,-1,a,b,c,d,e,4);g("x","y","z",-1,-1,a,b,-c,d,e,5);this.setIndex(k);this.addAttribute("position",new E(m,3));this.addAttribute("normal",new E(r,3));this.addAttribute("uv",new E(q,2))}function vc(a,b,c,d){P.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new kb(a,b,c,d))}function kb(a,b,c,d){H.call(this);this.type=
-"PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,m=b/d,r=[],q=[],n=[],u=[];for(a=0;a<h;a++){var l=a*m-f;for(b=0;b<g;b++)q.push(b*k-e,-l,0),n.push(0,0,1),u.push(b/c),u.push(1-a/d)}for(a=0;a<d;a++)for(b=0;b<c;b++)e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,r.push(b+g*a,e,h),r.push(e,f,h);this.setIndex(r);this.addAttribute("position",new E(q,3));this.addAttribute("normal",new E(n,3));this.addAttribute("uv",
-new E(u,2))}function Na(){B.call(this);this.type="Camera";this.matrixWorldInverse=new L;this.projectionMatrix=new L}function xa(a,b,c,d){Na.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Gb(a,b,c,d,e,f){Na.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=a;
-this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Hf(a){var b={};return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return b[a.uuid]},remove:function(c){var d=b[c.uuid];d&&(a.deleteBuffer(d.buffer),delete b[c.uuid])},update:function(c,d){c.isInterleavedBufferAttribute&&(c=c.data);var e=b[c.uuid];if(void 0===e){var e=c.uuid,f=c,g=f.array,h=f.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,k=a.createBuffer();a.bindBuffer(d,
-k);a.bufferData(d,g,h);f.onUploadCallback();h=a.FLOAT;g instanceof Float32Array?h=a.FLOAT:g instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):g instanceof Uint16Array?h=a.UNSIGNED_SHORT:g instanceof Int16Array?h=a.SHORT:g instanceof Uint32Array?h=a.UNSIGNED_INT:g instanceof Int32Array?h=a.INT:g instanceof Int8Array?h=a.BYTE:g instanceof Uint8Array&&(h=a.UNSIGNED_BYTE);b[e]={buffer:k,type:h,bytesPerElement:g.BYTES_PER_ELEMENT,version:f.version}}else e.version<c.version&&
-(f=c,g=f.array,k=f.updateRange,a.bindBuffer(d,e.buffer),!1===f.dynamic?a.bufferData(d,g,a.STATIC_DRAW):-1===k.count?a.bufferSubData(d,0,g):0===k.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(d,k.offset*g.BYTES_PER_ELEMENT,g.subarray(k.offset,k.offset+k.count)),k.count=0),e.version=c.version)}}}function If(a,b){return a.renderOrder!==b.renderOrder?
-a.renderOrder-b.renderOrder:a.program&&b.program&&a.program!==b.program?a.program.id-b.program.id:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function Jf(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function Kf(){var a=[],b=-1,c=[],d=-1;return{opaque:a,transparent:c,init:function(){d=b=-1},push:function(e,f,g,h,k){var m,r;g.transparent?(m=c,r=++d):(m=a,r=++b);(r=m[r])?(r.id=e.id,r.object=e,r.geometry=f,
-r.material=g,r.program=g.program,r.renderOrder=e.renderOrder,r.z=h,r.group=k):(r={id:e.id,object:e,geometry:f,material:g,program:g.program,renderOrder:e.renderOrder,z:h,group:k},m.push(r))},finish:function(){a.length=b+1;c.length=d+1},sort:function(){a.sort(If);c.sort(Jf)}}}function Lf(){var a={};return{get:function(b,c){var d=b.id+","+c.id,e=a[d];void 0===e&&(console.log("THREE.WebGLRenderLists:",d),e=new Kf,a[d]=e);return e},dispose:function(){a={}}}}function Mf(a,b,c){var d,e,f;this.setMode=function(a){d=
-a};this.setIndex=function(c){c.array instanceof Uint32Array&&b.get("OES_element_index_uint")?(e=a.UNSIGNED_INT,f=4):c.array instanceof Uint16Array?(e=a.UNSIGNED_SHORT,f=2):(e=a.UNSIGNED_BYTE,f=1)};this.render=function(b,h){a.drawElements(d,h,e,b*f);c.calls++;c.vertices+=h;d===a.TRIANGLES&&(c.faces+=h/3)};this.renderInstances=function(g,h,k){var m=b.get("ANGLE_instanced_arrays");null===m?console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):
+!1}function Pd(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;c<d;++c)a[c]>b&&(b=a[c]);return b}function P(){Object.defineProperty(this,"id",{value:Qd++});this.uuid=X.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=
+this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function H(){Object.defineProperty(this,"id",{value:Qd++});this.uuid=X.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}}function wa(a,b){B.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new H;this.material=void 0!==b?
+b:new Ha({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Fb(a,b,c,d,e,f){P.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new jb(a,b,c,d,e,f));this.mergeVertices()}function jb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,l,C,F,G){var Z=f/C,aa=g/F,ua=f/2,I=g/2,D=l/2;g=C+1;var E=F+1,B=f=0,Q,O,W=new p;for(O=0;O<E;O++){var ka=O*aa-I;for(Q=0;Q<g;Q++)W[a]=(Q*Z-ua)*d,W[b]=ka*
+e,W[c]=D,m.push(W.x,W.y,W.z),W[a]=0,W[b]=0,W[c]=0<l?1:-1,r.push(W.x,W.y,W.z),q.push(Q/C),q.push(1-O/F),f+=1}for(O=0;O<F;O++)for(Q=0;Q<C;Q++)a=n+Q+g*(O+1),b=n+(Q+1)+g*(O+1),c=n+(Q+1)+g*O,k.push(n+Q+g*O,a,c),k.push(a,b,c),B+=6;h.addGroup(u,B,G);u+=B;n+=f}H.call(this);this.type="BoxBufferGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};var h=this;d=Math.floor(d)||1;e=Math.floor(e)||1;f=Math.floor(f)||1;var k=[],m=[],r=[],q=[],n=0,u=0;g("z","y","x",
+-1,-1,c,b,a,f,e,0);g("z","y","x",1,-1,c,b,-a,f,e,1);g("x","z","y",1,1,a,c,b,d,f,2);g("x","z","y",1,-1,a,c,-b,d,f,3);g("x","y","z",1,-1,a,b,c,d,e,4);g("x","y","z",-1,-1,a,b,-c,d,e,5);this.setIndex(k);this.addAttribute("position",new E(m,3));this.addAttribute("normal",new E(r,3));this.addAttribute("uv",new E(q,2))}function vc(a,b,c,d){P.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new kb(a,b,c,d))}function kb(a,b,c,
+d){H.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,m=b/d,r=[],q=[],n=[],u=[];for(a=0;a<h;a++){var l=a*m-f;for(b=0;b<g;b++)q.push(b*k-e,-l,0),n.push(0,0,1),u.push(b/c),u.push(1-a/d)}for(a=0;a<d;a++)for(b=0;b<c;b++)e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,r.push(b+g*a,e,h),r.push(e,f,h);this.setIndex(r);this.addAttribute("position",new E(q,3));this.addAttribute("normal",
+new E(n,3));this.addAttribute("uv",new E(u,2))}function Na(){B.call(this);this.type="Camera";this.matrixWorldInverse=new L;this.projectionMatrix=new L}function xa(a,b,c,d){Na.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Gb(a,b,c,d,e,f){Na.call(this);this.type="OrthographicCamera";this.zoom=
+1;this.view=null;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Hf(a){var b={};return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return b[a.uuid]},remove:function(c){var d=b[c.uuid];d&&(a.deleteBuffer(d.buffer),delete b[c.uuid])},update:function(c,d){c.isInterleavedBufferAttribute&&(c=c.data);var e=b[c.uuid];if(void 0===e){var e=c.uuid,f=c,g=f.array,h=f.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW,
+k=a.createBuffer();a.bindBuffer(d,k);a.bufferData(d,g,h);f.onUploadCallback();h=a.FLOAT;g instanceof Float32Array?h=a.FLOAT:g instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):g instanceof Uint16Array?h=a.UNSIGNED_SHORT:g instanceof Int16Array?h=a.SHORT:g instanceof Uint32Array?h=a.UNSIGNED_INT:g instanceof Int32Array?h=a.INT:g instanceof Int8Array?h=a.BYTE:g instanceof Uint8Array&&(h=a.UNSIGNED_BYTE);b[e]={buffer:k,type:h,bytesPerElement:g.BYTES_PER_ELEMENT,version:f.version}}else e.version<
+c.version&&(f=c,g=f.array,k=f.updateRange,a.bindBuffer(d,e.buffer),!1===f.dynamic?a.bufferData(d,g,a.STATIC_DRAW):-1===k.count?a.bufferSubData(d,0,g):0===k.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(d,k.offset*g.BYTES_PER_ELEMENT,g.subarray(k.offset,k.offset+k.count)),k.count=0),e.version=c.version)}}}function If(a,b){return a.renderOrder!==
+b.renderOrder?a.renderOrder-b.renderOrder:a.program&&b.program&&a.program!==b.program?a.program.id-b.program.id:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function Jf(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function Kf(){var a=[],b=-1,c=[],d=-1;return{opaque:a,transparent:c,init:function(){d=b=-1},push:function(e,f,g,h,k){var m,r;g.transparent?(m=c,r=++d):(m=a,r=++b);(r=m[r])?(r.id=e.id,r.object=e,
+r.geometry=f,r.material=g,r.program=g.program,r.renderOrder=e.renderOrder,r.z=h,r.group=k):(r={id:e.id,object:e,geometry:f,material:g,program:g.program,renderOrder:e.renderOrder,z:h,group:k},m.push(r))},finish:function(){a.length=b+1;c.length=d+1},sort:function(){a.sort(If);c.sort(Jf)}}}function Lf(){var a={};return{get:function(b,c){var d=b.id+","+c.id,e=a[d];void 0===e&&(console.log("THREE.WebGLRenderLists:",d),e=new Kf,a[d]=e);return e},dispose:function(){a={}}}}function Mf(a,b,c){var d,e,f;this.setMode=
+function(a){d=a};this.setIndex=function(c){c.array instanceof Uint32Array&&b.get("OES_element_index_uint")?(e=a.UNSIGNED_INT,f=4):c.array instanceof Uint16Array?(e=a.UNSIGNED_SHORT,f=2):(e=a.UNSIGNED_BYTE,f=1)};this.render=function(b,h){a.drawElements(d,h,e,b*f);c.calls++;c.vertices+=h;d===a.TRIANGLES&&(c.faces+=h/3)};this.renderInstances=function(g,h,k){var m=b.get("ANGLE_instanced_arrays");null===m?console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):
 (m.drawElementsInstancedANGLE(d,k,e,h*f,g.maxInstancedCount),c.calls++,c.vertices+=k*g.maxInstancedCount,d===a.TRIANGLES&&(c.faces+=g.maxInstancedCount*k/3))}}function Nf(a,b,c){var d;this.setMode=function(a){d=a};this.render=function(b,f){a.drawArrays(d,b,f);c.calls++;c.vertices+=f;d===a.TRIANGLES&&(c.faces+=f/3)};this.renderInstances=function(e,f,g){var h=b.get("ANGLE_instanced_arrays");if(null===h)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
 else{var k=e.attributes.position;k.isInterleavedBufferAttribute?(g=k.data.count,h.drawArraysInstancedANGLE(d,0,g,e.maxInstancedCount)):h.drawArraysInstancedANGLE(d,f,g,e.maxInstancedCount);c.calls++;c.vertices+=g*e.maxInstancedCount;d===a.TRIANGLES&&(c.faces+=e.maxInstancedCount*g/3)}}}function Of(a,b,c){function d(a){a=a.target;var h=e[a.id];null!==h.index&&b.remove(h.index);for(var k in h.attributes)b.remove(h.attributes[k]);a.removeEventListener("dispose",d);delete e[a.id];if(k=f[a.id])b.remove(k),
 delete f[a.id];if(k=f[h.id])b.remove(k),delete f[h.id];c.geometries--}var e={},f={};return{get:function(a,b){var f=e[b.id];if(f)return f;b.addEventListener("dispose",d);b.isBufferGeometry?f=b:b.isGeometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new H).setFromObject(a)),f=b._bufferGeometry);e[b.id]=f;c.geometries++;return f},update:function(c){var d=c.index,e=c.attributes;null!==d&&b.update(d,a.ELEMENT_ARRAY_BUFFER);for(var f in e)b.update(e[f],a.ARRAY_BUFFER);c=c.morphAttributes;for(f in c)for(var d=

+ 3 - 11
build/three.module.js

@@ -12291,21 +12291,13 @@ Object.assign( DirectGeometry.prototype, {
 
 function arrayMax( array ) {
 
-	if ( array.length === 0 ) {
-
-		return - Infinity;
-
-	}
+	if ( array.length === 0 ) return - Infinity;
 
 	var max = array[ 0 ];
 
-	for ( var i = 1; i < array.length; ++ i ) {
+	for ( var i = 1, l = array.length; i < l; ++ i ) {
 
-		if ( array[ i ] > max ) {
-
-			max = array[ i ];
-
-		}
+		if ( array[ i ] > max ) max = array[ i ];
 
 	}