Browse Source

Updated builds.

Mr.doob 1 year ago
parent
commit
9e1a30b490
3 changed files with 54 additions and 66 deletions
  1. 27 33
      build/three.cjs
  2. 27 33
      build/three.module.js
  3. 0 0
      build/three.module.min.js

+ 27 - 33
build/three.cjs

@@ -10683,7 +10683,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 		if ( position && position.isGLBufferAttribute ) {
 		if ( position && position.isGLBufferAttribute ) {
 
 
-			console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this );
+			console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
 
 
 			this.boundingBox.set(
 			this.boundingBox.set(
 				new Vector3( - Infinity, - Infinity, - Infinity ),
 				new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10753,7 +10753,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 		if ( position && position.isGLBufferAttribute ) {
 		if ( position && position.isGLBufferAttribute ) {
 
 
-			console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this );
+			console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
 
 
 			this.boundingSphere.set( new Vector3(), Infinity );
 			this.boundingSphere.set( new Vector3(), Infinity );
 
 
@@ -10870,24 +10870,21 @@ class BufferGeometry extends EventDispatcher {
 
 
 		}
 		}
 
 
-		const indices = index.array;
-		const positions = attributes.position.array;
-		const normals = attributes.normal.array;
-		const uvs = attributes.uv.array;
-
-		const nVertices = positions.length / 3;
+		const positionAttribute = attributes.position;
+		const normalAttribute = attributes.normal;
+		const uvAttribute = attributes.uv;
 
 
 		if ( this.hasAttribute( 'tangent' ) === false ) {
 		if ( this.hasAttribute( 'tangent' ) === false ) {
 
 
-			this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
+			this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
 
 
 		}
 		}
 
 
-		const tangents = this.getAttribute( 'tangent' ).array;
+		const tangentAttribute = this.getAttribute( 'tangent' );
 
 
 		const tan1 = [], tan2 = [];
 		const tan1 = [], tan2 = [];
 
 
-		for ( let i = 0; i < nVertices; i ++ ) {
+		for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
 
 			tan1[ i ] = new Vector3();
 			tan1[ i ] = new Vector3();
 			tan2[ i ] = new Vector3();
 			tan2[ i ] = new Vector3();
@@ -10907,13 +10904,13 @@ class BufferGeometry extends EventDispatcher {
 
 
 		function handleTriangle( a, b, c ) {
 		function handleTriangle( a, b, c ) {
 
 
-			vA.fromArray( positions, a * 3 );
-			vB.fromArray( positions, b * 3 );
-			vC.fromArray( positions, c * 3 );
+			vA.fromBufferAttribute( positionAttribute, a );
+			vB.fromBufferAttribute( positionAttribute, b );
+			vC.fromBufferAttribute( positionAttribute, c );
 
 
-			uvA.fromArray( uvs, a * 2 );
-			uvB.fromArray( uvs, b * 2 );
-			uvC.fromArray( uvs, c * 2 );
+			uvA.fromBufferAttribute( uvAttribute, a );
+			uvB.fromBufferAttribute( uvAttribute, b );
+			uvC.fromBufferAttribute( uvAttribute, c );
 
 
 			vB.sub( vA );
 			vB.sub( vA );
 			vC.sub( vA );
 			vC.sub( vA );
@@ -10946,7 +10943,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 			groups = [ {
 			groups = [ {
 				start: 0,
 				start: 0,
-				count: indices.length
+				count: index.count
 			} ];
 			} ];
 
 
 		}
 		}
@@ -10961,9 +10958,9 @@ class BufferGeometry extends EventDispatcher {
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 
 
 				handleTriangle(
 				handleTriangle(
-					indices[ j + 0 ],
-					indices[ j + 1 ],
-					indices[ j + 2 ]
+					index.getX( j + 0 ),
+					index.getX( j + 1 ),
+					index.getX( j + 2 )
 				);
 				);
 
 
 			}
 			}
@@ -10975,7 +10972,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 		function handleVertex( v ) {
 		function handleVertex( v ) {
 
 
-			n.fromArray( normals, v * 3 );
+			n.fromBufferAttribute( normalAttribute, v );
 			n2.copy( n );
 			n2.copy( n );
 
 
 			const t = tan1[ v ];
 			const t = tan1[ v ];
@@ -10991,10 +10988,7 @@ class BufferGeometry extends EventDispatcher {
 			const test = tmp2.dot( tan2[ v ] );
 			const test = tmp2.dot( tan2[ v ] );
 			const w = ( test < 0.0 ) ? - 1.0 : 1.0;
 			const w = ( test < 0.0 ) ? - 1.0 : 1.0;
 
 
-			tangents[ v * 4 ] = tmp.x;
-			tangents[ v * 4 + 1 ] = tmp.y;
-			tangents[ v * 4 + 2 ] = tmp.z;
-			tangents[ v * 4 + 3 ] = w;
+			tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
 
 
 		}
 		}
 
 
@@ -11007,9 +11001,9 @@ class BufferGeometry extends EventDispatcher {
 
 
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 
 
-				handleVertex( indices[ j + 0 ] );
-				handleVertex( indices[ j + 1 ] );
-				handleVertex( indices[ j + 2 ] );
+				handleVertex( index.getX( j + 0 ) );
+				handleVertex( index.getX( j + 1 ) );
+				handleVertex( index.getX( j + 2 ) );
 
 
 			}
 			}
 
 
@@ -51347,7 +51341,7 @@ class Raycaster {
 
 
 	intersectObject( object, recursive = true, intersects = [] ) {
 	intersectObject( object, recursive = true, intersects = [] ) {
 
 
-		intersectObject( object, this, intersects, recursive );
+		intersect( object, this, intersects, recursive );
 
 
 		intersects.sort( ascSort );
 		intersects.sort( ascSort );
 
 
@@ -51359,7 +51353,7 @@ class Raycaster {
 
 
 		for ( let i = 0, l = objects.length; i < l; i ++ ) {
 		for ( let i = 0, l = objects.length; i < l; i ++ ) {
 
 
-			intersectObject( objects[ i ], this, intersects, recursive );
+			intersect( objects[ i ], this, intersects, recursive );
 
 
 		}
 		}
 
 
@@ -51377,7 +51371,7 @@ function ascSort( a, b ) {
 
 
 }
 }
 
 
-function intersectObject( object, raycaster, intersects, recursive ) {
+function intersect( object, raycaster, intersects, recursive ) {
 
 
 	if ( object.layers.test( raycaster.layers ) ) {
 	if ( object.layers.test( raycaster.layers ) ) {
 
 
@@ -51391,7 +51385,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
 
 
 		for ( let i = 0, l = children.length; i < l; i ++ ) {
 		for ( let i = 0, l = children.length; i < l; i ++ ) {
 
 
-			intersectObject( children[ i ], raycaster, intersects, true );
+			intersect( children[ i ], raycaster, intersects, true );
 
 
 		}
 		}
 
 

+ 27 - 33
build/three.module.js

@@ -10681,7 +10681,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 		if ( position && position.isGLBufferAttribute ) {
 		if ( position && position.isGLBufferAttribute ) {
 
 
-			console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this );
+			console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
 
 
 			this.boundingBox.set(
 			this.boundingBox.set(
 				new Vector3( - Infinity, - Infinity, - Infinity ),
 				new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10751,7 +10751,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 		if ( position && position.isGLBufferAttribute ) {
 		if ( position && position.isGLBufferAttribute ) {
 
 
-			console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this );
+			console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
 
 
 			this.boundingSphere.set( new Vector3(), Infinity );
 			this.boundingSphere.set( new Vector3(), Infinity );
 
 
@@ -10868,24 +10868,21 @@ class BufferGeometry extends EventDispatcher {
 
 
 		}
 		}
 
 
-		const indices = index.array;
-		const positions = attributes.position.array;
-		const normals = attributes.normal.array;
-		const uvs = attributes.uv.array;
-
-		const nVertices = positions.length / 3;
+		const positionAttribute = attributes.position;
+		const normalAttribute = attributes.normal;
+		const uvAttribute = attributes.uv;
 
 
 		if ( this.hasAttribute( 'tangent' ) === false ) {
 		if ( this.hasAttribute( 'tangent' ) === false ) {
 
 
-			this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
+			this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
 
 
 		}
 		}
 
 
-		const tangents = this.getAttribute( 'tangent' ).array;
+		const tangentAttribute = this.getAttribute( 'tangent' );
 
 
 		const tan1 = [], tan2 = [];
 		const tan1 = [], tan2 = [];
 
 
-		for ( let i = 0; i < nVertices; i ++ ) {
+		for ( let i = 0; i < positionAttribute.count; i ++ ) {
 
 
 			tan1[ i ] = new Vector3();
 			tan1[ i ] = new Vector3();
 			tan2[ i ] = new Vector3();
 			tan2[ i ] = new Vector3();
@@ -10905,13 +10902,13 @@ class BufferGeometry extends EventDispatcher {
 
 
 		function handleTriangle( a, b, c ) {
 		function handleTriangle( a, b, c ) {
 
 
-			vA.fromArray( positions, a * 3 );
-			vB.fromArray( positions, b * 3 );
-			vC.fromArray( positions, c * 3 );
+			vA.fromBufferAttribute( positionAttribute, a );
+			vB.fromBufferAttribute( positionAttribute, b );
+			vC.fromBufferAttribute( positionAttribute, c );
 
 
-			uvA.fromArray( uvs, a * 2 );
-			uvB.fromArray( uvs, b * 2 );
-			uvC.fromArray( uvs, c * 2 );
+			uvA.fromBufferAttribute( uvAttribute, a );
+			uvB.fromBufferAttribute( uvAttribute, b );
+			uvC.fromBufferAttribute( uvAttribute, c );
 
 
 			vB.sub( vA );
 			vB.sub( vA );
 			vC.sub( vA );
 			vC.sub( vA );
@@ -10944,7 +10941,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 			groups = [ {
 			groups = [ {
 				start: 0,
 				start: 0,
-				count: indices.length
+				count: index.count
 			} ];
 			} ];
 
 
 		}
 		}
@@ -10959,9 +10956,9 @@ class BufferGeometry extends EventDispatcher {
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 
 
 				handleTriangle(
 				handleTriangle(
-					indices[ j + 0 ],
-					indices[ j + 1 ],
-					indices[ j + 2 ]
+					index.getX( j + 0 ),
+					index.getX( j + 1 ),
+					index.getX( j + 2 )
 				);
 				);
 
 
 			}
 			}
@@ -10973,7 +10970,7 @@ class BufferGeometry extends EventDispatcher {
 
 
 		function handleVertex( v ) {
 		function handleVertex( v ) {
 
 
-			n.fromArray( normals, v * 3 );
+			n.fromBufferAttribute( normalAttribute, v );
 			n2.copy( n );
 			n2.copy( n );
 
 
 			const t = tan1[ v ];
 			const t = tan1[ v ];
@@ -10989,10 +10986,7 @@ class BufferGeometry extends EventDispatcher {
 			const test = tmp2.dot( tan2[ v ] );
 			const test = tmp2.dot( tan2[ v ] );
 			const w = ( test < 0.0 ) ? - 1.0 : 1.0;
 			const w = ( test < 0.0 ) ? - 1.0 : 1.0;
 
 
-			tangents[ v * 4 ] = tmp.x;
-			tangents[ v * 4 + 1 ] = tmp.y;
-			tangents[ v * 4 + 2 ] = tmp.z;
-			tangents[ v * 4 + 3 ] = w;
+			tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
 
 
 		}
 		}
 
 
@@ -11005,9 +10999,9 @@ class BufferGeometry extends EventDispatcher {
 
 
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 			for ( let j = start, jl = start + count; j < jl; j += 3 ) {
 
 
-				handleVertex( indices[ j + 0 ] );
-				handleVertex( indices[ j + 1 ] );
-				handleVertex( indices[ j + 2 ] );
+				handleVertex( index.getX( j + 0 ) );
+				handleVertex( index.getX( j + 1 ) );
+				handleVertex( index.getX( j + 2 ) );
 
 
 			}
 			}
 
 
@@ -51345,7 +51339,7 @@ class Raycaster {
 
 
 	intersectObject( object, recursive = true, intersects = [] ) {
 	intersectObject( object, recursive = true, intersects = [] ) {
 
 
-		intersectObject( object, this, intersects, recursive );
+		intersect( object, this, intersects, recursive );
 
 
 		intersects.sort( ascSort );
 		intersects.sort( ascSort );
 
 
@@ -51357,7 +51351,7 @@ class Raycaster {
 
 
 		for ( let i = 0, l = objects.length; i < l; i ++ ) {
 		for ( let i = 0, l = objects.length; i < l; i ++ ) {
 
 
-			intersectObject( objects[ i ], this, intersects, recursive );
+			intersect( objects[ i ], this, intersects, recursive );
 
 
 		}
 		}
 
 
@@ -51375,7 +51369,7 @@ function ascSort( a, b ) {
 
 
 }
 }
 
 
-function intersectObject( object, raycaster, intersects, recursive ) {
+function intersect( object, raycaster, intersects, recursive ) {
 
 
 	if ( object.layers.test( raycaster.layers ) ) {
 	if ( object.layers.test( raycaster.layers ) ) {
 
 
@@ -51389,7 +51383,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
 
 
 		for ( let i = 0, l = children.length; i < l; i ++ ) {
 		for ( let i = 0, l = children.length; i < l; i ++ ) {
 
 
-			intersectObject( children[ i ], raycaster, intersects, true );
+			intersect( children[ i ], raycaster, intersects, true );
 
 
 		}
 		}
 
 

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