From 327513226688c5360b7e0457d00a93242adda85d Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 8 May 2014 05:08:58 +0200 Subject: [PATCH] Updated builds. --- build/three.js | 45 ++++++++++++++++++++++++++------------------- build/three.min.js | 8 ++++---- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/build/three.js b/build/three.js index cdc76a47f5..924c7c6d97 100644 --- a/build/three.js +++ b/build/three.js @@ -6,6 +6,13 @@ var THREE = { REVISION: '68dev' }; +// browserify support +if ( typeof module === 'object' ) { + + module.exports = THREE; + +} + self.console = self.console || { info: function () {}, @@ -14845,7 +14852,7 @@ THREE.MorphAnimMesh.prototype.parseAnimations = function () { var firstAnimation, animations = geometry.animations; - var pattern = /([a-z]+)(\d+)/; + var pattern = /([a-z]+)_?(\d+)/; for ( var i = 0, il = geometry.morphTargets.length; i < il; i ++ ) { @@ -20571,10 +20578,10 @@ THREE.WebGLRenderer = function ( parameters ) { var size = 1; // "f" and "i" - if( attribute.type === "v2" ) size = 2; - else if( attribute.type === "v3" ) size = 3; - else if( attribute.type === "v4" ) size = 4; - else if( attribute.type === "c" ) size = 3; + if ( attribute.type === "v2" ) size = 2; + else if ( attribute.type === "v3" ) size = 3; + else if ( attribute.type === "v4" ) size = 4; + else if ( attribute.type === "c" ) size = 3; attribute.size = size; @@ -22044,7 +22051,7 @@ THREE.WebGLRenderer = function ( parameters ) { normalArray, i, il = object.count * 3; - for( i = 0; i < il; i += 9 ) { + for ( i = 0; i < il; i += 9 ) { normalArray = object.normalArray; @@ -22307,7 +22314,7 @@ THREE.WebGLRenderer = function ( parameters ) { var type, size; - if ( index.array instanceof Uint32Array ){ + if ( index.array instanceof Uint32Array ) { type = _gl.UNSIGNED_INT; size = 4; @@ -23472,7 +23479,7 @@ THREE.WebGLRenderer = function ( parameters ) { // check all geometry groups - for( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) { + for ( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) { geometryGroup = geometry.geometryGroupsList[ i ]; @@ -24528,7 +24535,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - for( i = 0, il = uniform.value.length; i < il; i ++ ) { + for ( i = 0, il = uniform.value.length; i < il; i ++ ) { uniform._array[ i ] = getTextureUnit(); @@ -24536,7 +24543,7 @@ THREE.WebGLRenderer = function ( parameters ) { _gl.uniform1iv( location, uniform._array ); - for( i = 0, il = uniform.value.length; i < il; i ++ ) { + for ( i = 0, il = uniform.value.length; i < il; i ++ ) { texture = uniform.value[ i ]; textureUnit = uniform._array[ i ]; @@ -25135,10 +25142,10 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( texture instanceof THREE.CompressedTexture ) { - for( var i = 0, il = mipmaps.length; i < il; i ++ ) { + for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { mipmap = mipmaps[ i ]; - if ( texture.format!==THREE.RGBAFormat ) { + if ( texture.format !== THREE.RGBAFormat ) { _gl.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); } else { _gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); @@ -25260,7 +25267,7 @@ THREE.WebGLRenderer = function ( parameters ) { for ( var i = 0; i < 6; i ++ ) { - if( !isCompressed ) { + if ( !isCompressed ) { _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); @@ -25268,10 +25275,10 @@ THREE.WebGLRenderer = function ( parameters ) { var mipmap, mipmaps = cubeImage[ i ].mipmaps; - for( var j = 0, jl = mipmaps.length; j < jl; j ++ ) { + for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) { mipmap = mipmaps[ j ]; - if ( texture.format!==THREE.RGBAFormat ) { + if ( texture.format !== THREE.RGBAFormat ) { _gl.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); @@ -25330,7 +25337,7 @@ THREE.WebGLRenderer = function ( parameters ) { _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); /* For some reason this is not working. Defaulting to RGBA4. - } else if( ! renderTarget.depthBuffer && renderTarget.stencilBuffer ) { + } else if ( ! renderTarget.depthBuffer && renderTarget.stencilBuffer ) { _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.STENCIL_INDEX8, renderTarget.width, renderTarget.height ); _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); @@ -25662,7 +25669,7 @@ THREE.WebGLRenderer = function ( parameters ) { var maxShadows = 0; - for ( var l = 0, ll = lights.length; l < ll; l++ ) { + for ( var l = 0, ll = lights.length; l < ll; l ++ ) { var light = lights[ l ]; @@ -26358,7 +26365,7 @@ THREE.RenderableFace = function () { this.vertexNormalsModel = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ]; this.vertexNormalsLength = 0; - this.color = null; + this.color = new THREE.Color(); this.material = null; this.uvs = [ new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2() ]; @@ -35412,7 +35419,7 @@ THREE.MorphBlendMesh.prototype.createAnimation = function ( name, start, end, fp THREE.MorphBlendMesh.prototype.autoCreateAnimations = function ( fps ) { - var pattern = /([a-z]+)(\d+)/; + var pattern = /([a-z]+)_?(\d+)/; var firstAnimation, frameRanges = {}; diff --git a/build/three.min.js b/build/three.min.js index 055c87a7ed..e38bd9710b 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,5 +1,5 @@ // three.js / threejs.org/license -'use strict';var THREE={REVISION:"68dev"};self.console=self.console||{info:function(){},log:function(){},debug:function(){},warn:function(){},error:function(){}}; +'use strict';var THREE={REVISION:"68dev"};"object"===typeof module&&(module.exports=THREE);self.console=self.console||{info:function(){},log:function(){},debug:function(){},warn:function(){},error:function(){}}; (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;ch.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; +THREE.MorphAnimMesh.prototype.parseAnimations=function(){var a=this.geometry;a.animations||(a.animations={});for(var b,c=a.animations,d=/([a-z]+)_?(\d+)/,e=0,f=a.morphTargets.length;eh.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&& (this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b}; @@ -515,7 +515,7 @@ b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap "#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));h=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+h);g=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+g);f.attachShader(p,h);f.attachShader(p,g);void 0!==q&&f.bindAttribLocation(p,0,q);f.linkProgram(p);!1===f.getProgramParameter(p,f.LINK_STATUS)&&(console.error("Could not initialise shader"), console.error("gl.VALIDATE_STATUS",f.getProgramParameter(p,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(p)&&console.error("gl.getProgramInfoLog()",f.getProgramInfoLog(p));f.deleteShader(h);f.deleteShader(g);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&& q.push("logDepthBufFC");for(var v in k)q.push(v);k=q;v={};q=0;for(b=k.length;qa?b(c,e-1):l[e]h.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; +THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b=/([a-z]+)_?(\d+)/,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;fh.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; -- GitLab