Skip to content

Commit 9e1a30b

Browse files
committed
Updated builds.
1 parent a9747f3 commit 9e1a30b

File tree

3 files changed

+55
-67
lines changed

3 files changed

+55
-67
lines changed

build/three.cjs

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10683,7 +10683,7 @@ class BufferGeometry extends EventDispatcher {
1068310683

1068410684
if ( position && position.isGLBufferAttribute ) {
1068510685

10686-
console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this );
10686+
console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
1068710687

1068810688
this.boundingBox.set(
1068910689
new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10753,7 +10753,7 @@ class BufferGeometry extends EventDispatcher {
1075310753

1075410754
if ( position && position.isGLBufferAttribute ) {
1075510755

10756-
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this );
10756+
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
1075710757

1075810758
this.boundingSphere.set( new Vector3(), Infinity );
1075910759

@@ -10870,24 +10870,21 @@ class BufferGeometry extends EventDispatcher {
1087010870

1087110871
}
1087210872

10873-
const indices = index.array;
10874-
const positions = attributes.position.array;
10875-
const normals = attributes.normal.array;
10876-
const uvs = attributes.uv.array;
10877-
10878-
const nVertices = positions.length / 3;
10873+
const positionAttribute = attributes.position;
10874+
const normalAttribute = attributes.normal;
10875+
const uvAttribute = attributes.uv;
1087910876

1088010877
if ( this.hasAttribute( 'tangent' ) === false ) {
1088110878

10882-
this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
10879+
this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
1088310880

1088410881
}
1088510882

10886-
const tangents = this.getAttribute( 'tangent' ).array;
10883+
const tangentAttribute = this.getAttribute( 'tangent' );
1088710884

1088810885
const tan1 = [], tan2 = [];
1088910886

10890-
for ( let i = 0; i < nVertices; i ++ ) {
10887+
for ( let i = 0; i < positionAttribute.count; i ++ ) {
1089110888

1089210889
tan1[ i ] = new Vector3();
1089310890
tan2[ i ] = new Vector3();
@@ -10907,13 +10904,13 @@ class BufferGeometry extends EventDispatcher {
1090710904

1090810905
function handleTriangle( a, b, c ) {
1090910906

10910-
vA.fromArray( positions, a * 3 );
10911-
vB.fromArray( positions, b * 3 );
10912-
vC.fromArray( positions, c * 3 );
10907+
vA.fromBufferAttribute( positionAttribute, a );
10908+
vB.fromBufferAttribute( positionAttribute, b );
10909+
vC.fromBufferAttribute( positionAttribute, c );
1091310910

10914-
uvA.fromArray( uvs, a * 2 );
10915-
uvB.fromArray( uvs, b * 2 );
10916-
uvC.fromArray( uvs, c * 2 );
10911+
uvA.fromBufferAttribute( uvAttribute, a );
10912+
uvB.fromBufferAttribute( uvAttribute, b );
10913+
uvC.fromBufferAttribute( uvAttribute, c );
1091710914

1091810915
vB.sub( vA );
1091910916
vC.sub( vA );
@@ -10946,7 +10943,7 @@ class BufferGeometry extends EventDispatcher {
1094610943

1094710944
groups = [ {
1094810945
start: 0,
10949-
count: indices.length
10946+
count: index.count
1095010947
} ];
1095110948

1095210949
}
@@ -10961,9 +10958,9 @@ class BufferGeometry extends EventDispatcher {
1096110958
for ( let j = start, jl = start + count; j < jl; j += 3 ) {
1096210959

1096310960
handleTriangle(
10964-
indices[ j + 0 ],
10965-
indices[ j + 1 ],
10966-
indices[ j + 2 ]
10961+
index.getX( j + 0 ),
10962+
index.getX( j + 1 ),
10963+
index.getX( j + 2 )
1096710964
);
1096810965

1096910966
}
@@ -10975,7 +10972,7 @@ class BufferGeometry extends EventDispatcher {
1097510972

1097610973
function handleVertex( v ) {
1097710974

10978-
n.fromArray( normals, v * 3 );
10975+
n.fromBufferAttribute( normalAttribute, v );
1097910976
n2.copy( n );
1098010977

1098110978
const t = tan1[ v ];
@@ -10991,10 +10988,7 @@ class BufferGeometry extends EventDispatcher {
1099110988
const test = tmp2.dot( tan2[ v ] );
1099210989
const w = ( test < 0.0 ) ? - 1.0 : 1.0;
1099310990

10994-
tangents[ v * 4 ] = tmp.x;
10995-
tangents[ v * 4 + 1 ] = tmp.y;
10996-
tangents[ v * 4 + 2 ] = tmp.z;
10997-
tangents[ v * 4 + 3 ] = w;
10991+
tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
1099810992

1099910993
}
1100010994

@@ -11007,9 +11001,9 @@ class BufferGeometry extends EventDispatcher {
1100711001

1100811002
for ( let j = start, jl = start + count; j < jl; j += 3 ) {
1100911003

11010-
handleVertex( indices[ j + 0 ] );
11011-
handleVertex( indices[ j + 1 ] );
11012-
handleVertex( indices[ j + 2 ] );
11004+
handleVertex( index.getX( j + 0 ) );
11005+
handleVertex( index.getX( j + 1 ) );
11006+
handleVertex( index.getX( j + 2 ) );
1101311007

1101411008
}
1101511009

@@ -51347,7 +51341,7 @@ class Raycaster {
5134751341

5134851342
intersectObject( object, recursive = true, intersects = [] ) {
5134951343

51350-
intersectObject( object, this, intersects, recursive );
51344+
intersect( object, this, intersects, recursive );
5135151345

5135251346
intersects.sort( ascSort );
5135351347

@@ -51359,7 +51353,7 @@ class Raycaster {
5135951353

5136051354
for ( let i = 0, l = objects.length; i < l; i ++ ) {
5136151355

51362-
intersectObject( objects[ i ], this, intersects, recursive );
51356+
intersect( objects[ i ], this, intersects, recursive );
5136351357

5136451358
}
5136551359

@@ -51377,7 +51371,7 @@ function ascSort( a, b ) {
5137751371

5137851372
}
5137951373

51380-
function intersectObject( object, raycaster, intersects, recursive ) {
51374+
function intersect( object, raycaster, intersects, recursive ) {
5138151375

5138251376
if ( object.layers.test( raycaster.layers ) ) {
5138351377

@@ -51391,7 +51385,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
5139151385

5139251386
for ( let i = 0, l = children.length; i < l; i ++ ) {
5139351387

51394-
intersectObject( children[ i ], raycaster, intersects, true );
51388+
intersect( children[ i ], raycaster, intersects, true );
5139551389

5139651390
}
5139751391

build/three.module.js

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10681,7 +10681,7 @@ class BufferGeometry extends EventDispatcher {
1068110681

1068210682
if ( position && position.isGLBufferAttribute ) {
1068310683

10684-
console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this );
10684+
console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
1068510685

1068610686
this.boundingBox.set(
1068710687
new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10751,7 +10751,7 @@ class BufferGeometry extends EventDispatcher {
1075110751

1075210752
if ( position && position.isGLBufferAttribute ) {
1075310753

10754-
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this );
10754+
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
1075510755

1075610756
this.boundingSphere.set( new Vector3(), Infinity );
1075710757

@@ -10868,24 +10868,21 @@ class BufferGeometry extends EventDispatcher {
1086810868

1086910869
}
1087010870

10871-
const indices = index.array;
10872-
const positions = attributes.position.array;
10873-
const normals = attributes.normal.array;
10874-
const uvs = attributes.uv.array;
10875-
10876-
const nVertices = positions.length / 3;
10871+
const positionAttribute = attributes.position;
10872+
const normalAttribute = attributes.normal;
10873+
const uvAttribute = attributes.uv;
1087710874

1087810875
if ( this.hasAttribute( 'tangent' ) === false ) {
1087910876

10880-
this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
10877+
this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
1088110878

1088210879
}
1088310880

10884-
const tangents = this.getAttribute( 'tangent' ).array;
10881+
const tangentAttribute = this.getAttribute( 'tangent' );
1088510882

1088610883
const tan1 = [], tan2 = [];
1088710884

10888-
for ( let i = 0; i < nVertices; i ++ ) {
10885+
for ( let i = 0; i < positionAttribute.count; i ++ ) {
1088910886

1089010887
tan1[ i ] = new Vector3();
1089110888
tan2[ i ] = new Vector3();
@@ -10905,13 +10902,13 @@ class BufferGeometry extends EventDispatcher {
1090510902

1090610903
function handleTriangle( a, b, c ) {
1090710904

10908-
vA.fromArray( positions, a * 3 );
10909-
vB.fromArray( positions, b * 3 );
10910-
vC.fromArray( positions, c * 3 );
10905+
vA.fromBufferAttribute( positionAttribute, a );
10906+
vB.fromBufferAttribute( positionAttribute, b );
10907+
vC.fromBufferAttribute( positionAttribute, c );
1091110908

10912-
uvA.fromArray( uvs, a * 2 );
10913-
uvB.fromArray( uvs, b * 2 );
10914-
uvC.fromArray( uvs, c * 2 );
10909+
uvA.fromBufferAttribute( uvAttribute, a );
10910+
uvB.fromBufferAttribute( uvAttribute, b );
10911+
uvC.fromBufferAttribute( uvAttribute, c );
1091510912

1091610913
vB.sub( vA );
1091710914
vC.sub( vA );
@@ -10944,7 +10941,7 @@ class BufferGeometry extends EventDispatcher {
1094410941

1094510942
groups = [ {
1094610943
start: 0,
10947-
count: indices.length
10944+
count: index.count
1094810945
} ];
1094910946

1095010947
}
@@ -10959,9 +10956,9 @@ class BufferGeometry extends EventDispatcher {
1095910956
for ( let j = start, jl = start + count; j < jl; j += 3 ) {
1096010957

1096110958
handleTriangle(
10962-
indices[ j + 0 ],
10963-
indices[ j + 1 ],
10964-
indices[ j + 2 ]
10959+
index.getX( j + 0 ),
10960+
index.getX( j + 1 ),
10961+
index.getX( j + 2 )
1096510962
);
1096610963

1096710964
}
@@ -10973,7 +10970,7 @@ class BufferGeometry extends EventDispatcher {
1097310970

1097410971
function handleVertex( v ) {
1097510972

10976-
n.fromArray( normals, v * 3 );
10973+
n.fromBufferAttribute( normalAttribute, v );
1097710974
n2.copy( n );
1097810975

1097910976
const t = tan1[ v ];
@@ -10989,10 +10986,7 @@ class BufferGeometry extends EventDispatcher {
1098910986
const test = tmp2.dot( tan2[ v ] );
1099010987
const w = ( test < 0.0 ) ? - 1.0 : 1.0;
1099110988

10992-
tangents[ v * 4 ] = tmp.x;
10993-
tangents[ v * 4 + 1 ] = tmp.y;
10994-
tangents[ v * 4 + 2 ] = tmp.z;
10995-
tangents[ v * 4 + 3 ] = w;
10989+
tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
1099610990

1099710991
}
1099810992

@@ -11005,9 +10999,9 @@ class BufferGeometry extends EventDispatcher {
1100510999

1100611000
for ( let j = start, jl = start + count; j < jl; j += 3 ) {
1100711001

11008-
handleVertex( indices[ j + 0 ] );
11009-
handleVertex( indices[ j + 1 ] );
11010-
handleVertex( indices[ j + 2 ] );
11002+
handleVertex( index.getX( j + 0 ) );
11003+
handleVertex( index.getX( j + 1 ) );
11004+
handleVertex( index.getX( j + 2 ) );
1101111005

1101211006
}
1101311007

@@ -51345,7 +51339,7 @@ class Raycaster {
5134551339

5134651340
intersectObject( object, recursive = true, intersects = [] ) {
5134751341

51348-
intersectObject( object, this, intersects, recursive );
51342+
intersect( object, this, intersects, recursive );
5134951343

5135051344
intersects.sort( ascSort );
5135151345

@@ -51357,7 +51351,7 @@ class Raycaster {
5135751351

5135851352
for ( let i = 0, l = objects.length; i < l; i ++ ) {
5135951353

51360-
intersectObject( objects[ i ], this, intersects, recursive );
51354+
intersect( objects[ i ], this, intersects, recursive );
5136151355

5136251356
}
5136351357

@@ -51375,7 +51369,7 @@ function ascSort( a, b ) {
5137551369

5137651370
}
5137751371

51378-
function intersectObject( object, raycaster, intersects, recursive ) {
51372+
function intersect( object, raycaster, intersects, recursive ) {
5137951373

5138051374
if ( object.layers.test( raycaster.layers ) ) {
5138151375

@@ -51389,7 +51383,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
5138951383

5139051384
for ( let i = 0, l = children.length; i < l; i ++ ) {
5139151385

51392-
intersectObject( children[ i ], raycaster, intersects, true );
51386+
intersect( children[ i ], raycaster, intersects, true );
5139351387

5139451388
}
5139551389

build/three.module.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)