Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
4d02423309
2 changed files with 19 additions and 14 deletions
  1. 17 12
      build/three.js
  2. 2 2
      build/three.min.js

+ 17 - 12
build/three.js

@@ -35,7 +35,7 @@ if ( typeof module === 'object' ) {
 			var currTime = Date.now(), timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) );
 			var id = self.setTimeout( function () {
 
-				callback( currTime + timeToCall )
+				callback( currTime + timeToCall );
 
 			}, timeToCall );
 			lastTime = currTime + timeToCall;
@@ -49,7 +49,7 @@ if ( typeof module === 'object' ) {
 
 		self.cancelAnimationFrame = function ( id ) {
 
-			self.clearTimeout( id )
+			self.clearTimeout( id );
 
 		};
 
@@ -20635,11 +20635,16 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var influence = activeInfluences[ i ];
 				morphInfluences[ i ] = influence[ 0 ];
 
-				var attribute = geometry.morphAttributes[ influence[ 1 ] ];
 
-				objects.updateAttribute( attribute );
+				if ( influence[ 0 ] !== 0 ) {
 
-				geometry.addAttribute( 'morphTarget' + i, attribute );
+					var attribute = geometry.morphAttributes[ influence[ 1 ] ];
+
+					objects.updateAttribute( attribute );
+
+					geometry.addAttribute( 'morphTarget' + i, attribute );
+
+				}
 
 			}
 
@@ -28647,7 +28652,7 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) {
 
 			for ( j = 1; j <= n; j ++ ) {
 
-				points.push( spline.getPointAt( j / n ) ) ;
+				points.push( spline.getPointAt( j / n ) );
 
 			}
 
@@ -31975,7 +31980,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 	}
 
-	// Variables initialization 
+	// Variables initialization
 
 	var ahole, h, hl; // looping of holes
 	var scope = this;
@@ -31987,7 +31992,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 	var vertices = shapePoints.shape;
 	var holes = shapePoints.holes;
 
-	var reverse = ! THREE.Shape.Utils.isClockWise( vertices ) ;
+	var reverse = ! THREE.Shape.Utils.isClockWise( vertices );
 
 	if ( reverse ) {
 
@@ -32214,8 +32219,8 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 		z = bevelThickness * ( 1 - t );
 
 		//z = bevelThickness * t;
-		bs = bevelSize * ( Math.sin ( t * Math.PI / 2 ) ) ; // curved
-		//bs = bevelSize * t ; // linear
+		bs = bevelSize * ( Math.sin ( t * Math.PI / 2 ) ); // curved
+		//bs = bevelSize * t; // linear
 
 		// contract shape
 
@@ -32314,7 +32319,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 		t = b / bevelSegments;
 		z = bevelThickness * ( 1 - t );
 		//bs = bevelSize * ( 1-Math.sin ( ( 1 - t ) * Math.PI/2 ) );
-		bs = bevelSize * Math.sin ( t * Math.PI / 2 ) ;
+		bs = bevelSize * Math.sin ( t * Math.PI / 2 );
 
 		// contract shape
 
@@ -32369,7 +32374,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 		if ( bevelEnabled ) {
 
-			var layer = 0 ; // steps + 1
+			var layer = 0; // steps + 1
 			var offset = vlen * layer;
 
 			// Bottom faces

+ 2 - 2
build/three.min.js

@@ -558,8 +558,8 @@ c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BU
 !d.__webglVertexBuffer&&(d.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=r.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglVertexBuffer),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),N.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,
 !1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,m,n,p,q,t,s=3*a.count;for(t=0;t<s;t+=9)q=a.normalArray,e=q[t],f=q[t+1],g=q[t+2],h=q[t+3],l=q[t+4],n=q[t+5],k=q[t+6],m=q[t+7],p=q[t+8],e=(e+h+k)/3,f=(f+l+m)/3,g=(g+n+p)/3,q[t]=e,q[t+1]=f,q[t+2]=g,q[t+3]=e,q[t+4]=f,q[t+5]=g,q[t+6]=e,q[t+7]=f,q[t+8]=g}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);N.enableAttribute(b.normal);
 r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),N.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),N.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));N.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,
-0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(!1!==d.visible){s(d);var f=ka.geometries.get(e);a=x(a,b,c,d,e);c=!1;b=f.id+"_"+a.id+"_"+(d.wireframe?1:0);b!==Da&&(Da=b,c=!0);c&&N.initAttributes();b=e.morphTargetInfluences;if(void 0!==b){c=[];for(var g=0,h=b.length;g<h;g++){var m=b[g];c.push([m,g])}c.sort(l);8<c.length&&(c.length=8);g=0;for(h=c.length;g<h;g++)m=c[g],xa[g]=m[0],b=f.morphAttributes[m[1]],ka.updateAttribute(b),f.addAttribute("morphTarget"+g,b);b=a.getUniforms();null!==
-b.morphTargetInfluences&&r.uniform1fv(b.morphTargetInfluences,xa);c=!0}if(e instanceof THREE.Mesh)a:{b=c;e=r.TRIANGLES;!0===d.wireframe&&(e=r.LINES,N.setLineWidth(d.wireframeLinewidth*C));var n=f.attributes.index;if(n)if(h=ka.getAttributeBuffer(n),n.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,g=4):(c=r.UNSIGNED_SHORT,g=2),m=f.drawcalls,0===m.length){b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var p=
+0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(!1!==d.visible){s(d);var f=ka.geometries.get(e);a=x(a,b,c,d,e);c=!1;b=f.id+"_"+a.id+"_"+(d.wireframe?1:0);b!==Da&&(Da=b,c=!0);c&&N.initAttributes();b=e.morphTargetInfluences;if(void 0!==b){c=[];for(var g=0,h=b.length;g<h;g++){var m=b[g];c.push([m,g])}c.sort(l);8<c.length&&(c.length=8);g=0;for(h=c.length;g<h;g++)m=c[g],xa[g]=m[0],0!==m[0]&&(b=f.morphAttributes[m[1]],ka.updateAttribute(b),f.addAttribute("morphTarget"+g,b));b=a.getUniforms();
+null!==b.morphTargetInfluences&&r.uniform1fv(b.morphTargetInfluences,xa);c=!0}if(e instanceof THREE.Mesh)a:{b=c;e=r.TRIANGLES;!0===d.wireframe&&(e=r.LINES,N.setLineWidth(d.wireframeLinewidth*C));var n=f.attributes.index;if(n)if(h=ka.getAttributeBuffer(n),n.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,g=4):(c=r.UNSIGNED_SHORT,g=2),m=f.drawcalls,0===m.length){b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var p=
 W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(e,n.array.length,c,0,f.maxInstancedCount)}else r.drawElements(e,n.array.length,c,0);P.calls++;P.vertices+=n.array.length;P.faces+=n.array.length/3}else{b=!0;for(var n=0,q=m.length;n<q;n++){p=m[n].index;b&&(k(d,a,f,p),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof
 THREE.InstancedBufferGeometry&&0<m[n].instances){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(e,m[n].count,c,m[n].start*g,m[n].count,c,m[n].instances)}else r.drawElements(e,m[n].count,c,m[n].start*g);P.calls++;P.vertices+=m[n].count;P.faces+=m[n].count/3}}else if(m=f.drawcalls,0===m.length){b&&k(d,a,f,0);d=f.attributes.position;
 if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}d instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(e,0,d.data.count,f.maxInstancedCount):p.drawArraysInstancedANGLE(e,0,d.count,f.maxInstancedCount)}else d instanceof THREE.InterleavedBufferAttribute?r.drawArrays(e,