From e60612aad33e7f224ccdc8da9c7210f190a92739 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Fri, 6 Mar 2015 17:49:51 +0100 Subject: [PATCH] Updated builds. --- build/three.js | 18 ++++++++++++++++-- build/three.min.js | 45 +++++++++++++++++++++++---------------------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/build/three.js b/build/three.js index 122cd84739..e1994beeb6 100644 --- a/build/three.js +++ b/build/three.js @@ -8103,6 +8103,8 @@ THREE.Object3D.prototype = { data.geometry = parseGeometry( object.geometry ); data.material = parseMaterial( object.material ); + if ( object instanceof THREE.Line ) data.mode = object.mode; + } else if ( object instanceof THREE.Sprite ) { data.material = parseMaterial( object.material ); @@ -8555,6 +8557,18 @@ THREE.BufferGeometry.prototype = { } + if ( this.boundingBox instanceof THREE.Box3 ) { + + this.computeBoundingBox(); + + } + + if ( this.boundingSphere instanceof THREE.Sphere ) { + + this.computeBoundingSphere(); + + } + }, center: function () { @@ -13049,7 +13063,7 @@ THREE.ObjectLoader.prototype = { case 'Line': - object = new THREE.Line( getGeometry( data.geometry ), getMaterial( data.material ) ); + object = new THREE.Line( getGeometry( data.geometry ), getMaterial( data.material ), data.mode ); break; @@ -15062,7 +15076,7 @@ THREE.Line = function ( geometry, material, mode ) { this.geometry = geometry !== undefined ? geometry : new THREE.Geometry(); this.material = material !== undefined ? material : new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff } ); - this.mode = ( mode !== undefined ) ? mode : THREE.LineStrip; + this.mode = mode !== undefined ? mode : THREE.LineStrip; }; diff --git a/build/three.min.js b/build/three.min.js index 0498bfdb99..f481468274 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -170,9 +170,9 @@ b,c);return c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return this.parent.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;bqa?-1:1;h[4*a]=oa.x;h[4*a+1]=oa.y;h[4*a+2]=oa.z;h[4*a+3]=ca}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array, -e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],p=0;pr;r++)s=a[3*c+r],-1==n[s]?(q[2*r]=s,q[2*r+1]=-1,p++):n[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=q[p+1],-1p;p+=2)s=q[p],r=q[p+1],-1===r&&(r=g++),n[s]=r,t[r]=s,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;hqa?-1:1;h[4*a]=oa.x;h[4*a+1]=oa.y;h[4*a+2]=oa.z;h[4*a+3]=ca}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()"); +else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],p=0;pr;r++)s=a[3*c+r],-1==n[s]?(q[2*r]=s,q[2*r+1]=-1,p++):n[s]k.index+ +b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=q[p+1],-1p;p+=2)s=q[p],r=q[p+1],-1===r&&(r=g++),n[s]=r,t[r]=s,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array, +f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h