Browse Source

Updated builds.

Mugen87 1 year ago
parent
commit
aae82236de
5 changed files with 111 additions and 66 deletions
  1. 37 22
      build/three.cjs
  2. 37 22
      build/three.js
  3. 0 0
      build/three.min.js
  4. 37 22
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 37 - 22
build/three.cjs

@@ -4784,37 +4784,53 @@ class Box3 {
 
 		object.updateWorldMatrix( false, false );
 
-		if ( object.boundingBox !== undefined ) {
+		const geometry = object.geometry;
 
-			if ( object.boundingBox === null ) {
+		if ( geometry !== undefined ) {
 
-				object.computeBoundingBox();
+			const positionAttribute = geometry.getAttribute( 'position' );
 
-			}
+			// precise AABB computation based on vertex data requires at least a position attribute.
+			// instancing isn't supported so far and uses the normal (conservative) code path.
 
-			_box$3.copy( object.boundingBox );
-			_box$3.applyMatrix4( object.matrixWorld );
+			if ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {
 
-			this.union( _box$3 );
+				for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
 
-		} else {
+					if ( object.isMesh === true ) {
 
-			const geometry = object.geometry;
+						object.getVertexPosition( i, _vector$a );
+
+					} else {
+
+						_vector$a.fromBufferAttribute( positionAttribute, i );
+
+					}
+
+					_vector$a.applyMatrix4( object.matrixWorld );
+					this.expandByPoint( _vector$a );
 
-			if ( geometry !== undefined ) {
+				}
+
+			} else {
 
-				if ( precise && geometry.attributes !== undefined && geometry.attributes.position !== undefined ) {
+				if ( object.boundingBox !== undefined ) {
 
-					const position = geometry.attributes.position;
-					for ( let i = 0, l = position.count; i < l; i ++ ) {
+					// object-level bounding box
 
-						_vector$a.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );
-						this.expandByPoint( _vector$a );
+					if ( object.boundingBox === null ) {
+
+						object.computeBoundingBox();
 
 					}
 
+					_box$3.copy( object.boundingBox );
+
+
 				} else {
 
+					// geometry-level bounding box
+
 					if ( geometry.boundingBox === null ) {
 
 						geometry.computeBoundingBox();
@@ -4822,12 +4838,13 @@ class Box3 {
 					}
 
 					_box$3.copy( geometry.boundingBox );
-					_box$3.applyMatrix4( object.matrixWorld );
-
-					this.union( _box$3 );
 
 				}
 
+				_box$3.applyMatrix4( object.matrixWorld );
+
+				this.union( _box$3 );
+
 			}
 
 		}
@@ -31626,8 +31643,7 @@ class SkinnedMesh extends Mesh {
 
 		for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
-			_vertex.fromBufferAttribute( positionAttribute, i );
-			this.applyBoneTransform( i, _vertex );
+			this.getVertexPosition( i, _vertex );
 			this.boundingBox.expandByPoint( _vertex );
 
 		}
@@ -31650,8 +31666,7 @@ class SkinnedMesh extends Mesh {
 
 		for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
-			_vertex.fromBufferAttribute( positionAttribute, i );
-			this.applyBoneTransform( i, _vertex );
+			this.getVertexPosition( i, _vertex );
 			this.boundingSphere.expandByPoint( _vertex );
 
 		}

+ 37 - 22
build/three.js

@@ -4789,37 +4789,53 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			object.updateWorldMatrix( false, false );
 
-			if ( object.boundingBox !== undefined ) {
+			const geometry = object.geometry;
 
-				if ( object.boundingBox === null ) {
+			if ( geometry !== undefined ) {
 
-					object.computeBoundingBox();
+				const positionAttribute = geometry.getAttribute( 'position' );
 
-				}
+				// precise AABB computation based on vertex data requires at least a position attribute.
+				// instancing isn't supported so far and uses the normal (conservative) code path.
 
-				_box$3.copy( object.boundingBox );
-				_box$3.applyMatrix4( object.matrixWorld );
+				if ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {
 
-				this.union( _box$3 );
+					for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
 
-			} else {
+						if ( object.isMesh === true ) {
 
-				const geometry = object.geometry;
+							object.getVertexPosition( i, _vector$a );
+
+						} else {
+
+							_vector$a.fromBufferAttribute( positionAttribute, i );
+
+						}
+
+						_vector$a.applyMatrix4( object.matrixWorld );
+						this.expandByPoint( _vector$a );
 
-				if ( geometry !== undefined ) {
+					}
+
+				} else {
 
-					if ( precise && geometry.attributes !== undefined && geometry.attributes.position !== undefined ) {
+					if ( object.boundingBox !== undefined ) {
 
-						const position = geometry.attributes.position;
-						for ( let i = 0, l = position.count; i < l; i ++ ) {
+						// object-level bounding box
 
-							_vector$a.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );
-							this.expandByPoint( _vector$a );
+						if ( object.boundingBox === null ) {
+
+							object.computeBoundingBox();
 
 						}
 
+						_box$3.copy( object.boundingBox );
+
+
 					} else {
 
+						// geometry-level bounding box
+
 						if ( geometry.boundingBox === null ) {
 
 							geometry.computeBoundingBox();
@@ -4827,12 +4843,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 						}
 
 						_box$3.copy( geometry.boundingBox );
-						_box$3.applyMatrix4( object.matrixWorld );
-
-						this.union( _box$3 );
 
 					}
 
+					_box$3.applyMatrix4( object.matrixWorld );
+
+					this.union( _box$3 );
+
 				}
 
 			}
@@ -31631,8 +31648,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
-				_vertex.fromBufferAttribute( positionAttribute, i );
-				this.applyBoneTransform( i, _vertex );
+				this.getVertexPosition( i, _vertex );
 				this.boundingBox.expandByPoint( _vertex );
 
 			}
@@ -31655,8 +31671,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
-				_vertex.fromBufferAttribute( positionAttribute, i );
-				this.applyBoneTransform( i, _vertex );
+				this.getVertexPosition( i, _vertex );
 				this.boundingSphere.expandByPoint( _vertex );
 
 			}

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 37 - 22
build/three.module.js

@@ -4782,37 +4782,53 @@ class Box3 {
 
 		object.updateWorldMatrix( false, false );
 
-		if ( object.boundingBox !== undefined ) {
+		const geometry = object.geometry;
 
-			if ( object.boundingBox === null ) {
+		if ( geometry !== undefined ) {
 
-				object.computeBoundingBox();
+			const positionAttribute = geometry.getAttribute( 'position' );
 
-			}
+			// precise AABB computation based on vertex data requires at least a position attribute.
+			// instancing isn't supported so far and uses the normal (conservative) code path.
 
-			_box$3.copy( object.boundingBox );
-			_box$3.applyMatrix4( object.matrixWorld );
+			if ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {
 
-			this.union( _box$3 );
+				for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
 
-		} else {
+					if ( object.isMesh === true ) {
 
-			const geometry = object.geometry;
+						object.getVertexPosition( i, _vector$a );
+
+					} else {
+
+						_vector$a.fromBufferAttribute( positionAttribute, i );
+
+					}
+
+					_vector$a.applyMatrix4( object.matrixWorld );
+					this.expandByPoint( _vector$a );
 
-			if ( geometry !== undefined ) {
+				}
+
+			} else {
 
-				if ( precise && geometry.attributes !== undefined && geometry.attributes.position !== undefined ) {
+				if ( object.boundingBox !== undefined ) {
 
-					const position = geometry.attributes.position;
-					for ( let i = 0, l = position.count; i < l; i ++ ) {
+					// object-level bounding box
 
-						_vector$a.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );
-						this.expandByPoint( _vector$a );
+					if ( object.boundingBox === null ) {
+
+						object.computeBoundingBox();
 
 					}
 
+					_box$3.copy( object.boundingBox );
+
+
 				} else {
 
+					// geometry-level bounding box
+
 					if ( geometry.boundingBox === null ) {
 
 						geometry.computeBoundingBox();
@@ -4820,12 +4836,13 @@ class Box3 {
 					}
 
 					_box$3.copy( geometry.boundingBox );
-					_box$3.applyMatrix4( object.matrixWorld );
-
-					this.union( _box$3 );
 
 				}
 
+				_box$3.applyMatrix4( object.matrixWorld );
+
+				this.union( _box$3 );
+
 			}
 
 		}
@@ -31624,8 +31641,7 @@ class SkinnedMesh extends Mesh {
 
 		for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
-			_vertex.fromBufferAttribute( positionAttribute, i );
-			this.applyBoneTransform( i, _vertex );
+			this.getVertexPosition( i, _vertex );
 			this.boundingBox.expandByPoint( _vertex );
 
 		}
@@ -31648,8 +31664,7 @@ class SkinnedMesh extends Mesh {
 
 		for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
-			_vertex.fromBufferAttribute( positionAttribute, i );
-			this.applyBoneTransform( i, _vertex );
+			this.getVertexPosition( i, _vertex );
 			this.boundingSphere.expandByPoint( _vertex );
 
 		}

File diff suppressed because it is too large
+ 0 - 0
build/three.module.min.js


Some files were not shown because too many files changed in this diff