Skip to content

Commit 5a3de5c

Browse files
committed
Updated builds.
1 parent 117c815 commit 5a3de5c

7 files changed

Lines changed: 705 additions & 405 deletions

File tree

build/three.cjs

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37295,10 +37295,7 @@ function cloneUniforms( src ) {
3729537295

3729637296
const property = src[ u ][ p ];
3729737297

37298-
if ( property && ( property.isColor ||
37299-
property.isMatrix3 || property.isMatrix4 ||
37300-
property.isVector2 || property.isVector3 || property.isVector4 ||
37301-
property.isTexture || property.isQuaternion ) ) {
37298+
if ( isThreeObject( property ) ) {
3730237299

3730337300
if ( property.isRenderTargetTexture ) {
3730437301

@@ -37313,7 +37310,23 @@ function cloneUniforms( src ) {
3731337310

3731437311
} else if ( Array.isArray( property ) ) {
3731537312

37316-
dst[ u ][ p ] = property.slice();
37313+
if ( isThreeObject( property[ 0 ] ) ) {
37314+
37315+
const clonedProperty = [];
37316+
37317+
for ( let i = 0, l = property.length; i < l; i ++ ) {
37318+
37319+
clonedProperty[ i ] = property[ i ].clone();
37320+
37321+
}
37322+
37323+
dst[ u ][ p ] = clonedProperty;
37324+
37325+
} else {
37326+
37327+
dst[ u ][ p ] = property.slice();
37328+
37329+
}
3731737330

3731837331
} else {
3731937332

@@ -37357,6 +37370,15 @@ function mergeUniforms( uniforms ) {
3735737370

3735837371
}
3735937372

37373+
function isThreeObject( property ) {
37374+
37375+
return ( property && ( property.isColor ||
37376+
property.isMatrix3 || property.isMatrix4 ||
37377+
property.isVector2 || property.isVector3 || property.isVector4 ||
37378+
property.isTexture || property.isQuaternion ) );
37379+
37380+
}
37381+
3736037382
function cloneUniformsGroups( src ) {
3736137383

3736237384
const dst = [];
@@ -44051,7 +44073,6 @@ class FileLoader extends Loader {
4405144073
* @param {function(any)} onLoad - Executed when the loading process has been finished.
4405244074
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
4405344075
* @param {onErrorCallback} [onError] - Executed when errors occur.
44054-
* @return {any|undefined} The cached resource if available.
4405544076
*/
4405644077
load( url, onLoad, onProgress, onError ) {
4405744078

@@ -44075,7 +44096,7 @@ class FileLoader extends Loader {
4407544096

4407644097
}, 0 );
4407744098

44078-
return cached;
44099+
return;
4407944100

4408044101
}
4408144102

@@ -49525,6 +49546,9 @@ class ImageBitmapLoader extends Loader {
4952549546
* Sets the given loader options. The structure of the object must match the `options` parameter of
4952649547
* [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
4952749548
*
49549+
* Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
49550+
* different options will return the cached result of the first request.
49551+
*
4952849552
* @param {Object} options - The loader options to set.
4952949553
* @return {ImageBitmapLoader} A reference to this image bitmap loader.
4953049554
*/
@@ -49543,7 +49567,6 @@ class ImageBitmapLoader extends Loader {
4954349567
* @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
4954449568
* @param {onProgressCallback} onProgress - Unsupported in this loader.
4954549569
* @param {onErrorCallback} onError - Executed when errors occur.
49546-
* @return {ImageBitmap|undefined} The image bitmap.
4954749570
*/
4954849571
load( url, onLoad, onProgress, onError ) {
4954949572

@@ -49581,8 +49604,6 @@ class ImageBitmapLoader extends Loader {
4958149604

4958249605
scope.manager.itemEnd( url );
4958349606

49584-
return imageBitmap;
49585-
4958649607
}
4958749608

4958849609
} );
@@ -49600,7 +49621,7 @@ class ImageBitmapLoader extends Loader {
4960049621

4960149622
}, 0 );
4960249623

49603-
return cached;
49624+
return;
4960449625

4960549626
}
4960649627

@@ -49625,8 +49646,6 @@ class ImageBitmapLoader extends Loader {
4962549646

4962649647
scope.manager.itemEnd( url );
4962749648

49628-
return imageBitmap;
49629-
4963049649
} ).catch( function ( e ) {
4963149650

4963249651
if ( onError ) onError( e );
@@ -49757,11 +49776,21 @@ class AudioLoader extends Loader {
4975749776
const bufferCopy = buffer.slice( 0 );
4975849777

4975949778
const context = AudioContext.getContext();
49779+
49780+
const decodeUrl = url + '#decode';
49781+
scope.manager.itemStart( decodeUrl ); // prevent loading manager from completing too early, see #33378
49782+
4976049783
context.decodeAudioData( bufferCopy, function ( audioBuffer ) {
4976149784

4976249785
onLoad( audioBuffer );
49786+
scope.manager.itemEnd( decodeUrl );
4976349787

49764-
} ).catch( handleError );
49788+
} ).catch( function ( e ) {
49789+
49790+
handleError( e );
49791+
scope.manager.itemEnd( decodeUrl );
49792+
49793+
} );
4976549794

4976649795
} catch ( e ) {
4976749796

build/three.core.js

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37315,10 +37315,7 @@ function cloneUniforms( src ) {
3731537315

3731637316
const property = src[ u ][ p ];
3731737317

37318-
if ( property && ( property.isColor ||
37319-
property.isMatrix3 || property.isMatrix4 ||
37320-
property.isVector2 || property.isVector3 || property.isVector4 ||
37321-
property.isTexture || property.isQuaternion ) ) {
37318+
if ( isThreeObject( property ) ) {
3732237319

3732337320
if ( property.isRenderTargetTexture ) {
3732437321

@@ -37333,7 +37330,23 @@ function cloneUniforms( src ) {
3733337330

3733437331
} else if ( Array.isArray( property ) ) {
3733537332

37336-
dst[ u ][ p ] = property.slice();
37333+
if ( isThreeObject( property[ 0 ] ) ) {
37334+
37335+
const clonedProperty = [];
37336+
37337+
for ( let i = 0, l = property.length; i < l; i ++ ) {
37338+
37339+
clonedProperty[ i ] = property[ i ].clone();
37340+
37341+
}
37342+
37343+
dst[ u ][ p ] = clonedProperty;
37344+
37345+
} else {
37346+
37347+
dst[ u ][ p ] = property.slice();
37348+
37349+
}
3733737350

3733837351
} else {
3733937352

@@ -37377,6 +37390,15 @@ function mergeUniforms( uniforms ) {
3737737390

3737837391
}
3737937392

37393+
function isThreeObject( property ) {
37394+
37395+
return ( property && ( property.isColor ||
37396+
property.isMatrix3 || property.isMatrix4 ||
37397+
property.isVector2 || property.isVector3 || property.isVector4 ||
37398+
property.isTexture || property.isQuaternion ) );
37399+
37400+
}
37401+
3738037402
function cloneUniformsGroups( src ) {
3738137403

3738237404
const dst = [];
@@ -44071,7 +44093,6 @@ class FileLoader extends Loader {
4407144093
* @param {function(any)} onLoad - Executed when the loading process has been finished.
4407244094
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
4407344095
* @param {onErrorCallback} [onError] - Executed when errors occur.
44074-
* @return {any|undefined} The cached resource if available.
4407544096
*/
4407644097
load( url, onLoad, onProgress, onError ) {
4407744098

@@ -44095,7 +44116,7 @@ class FileLoader extends Loader {
4409544116

4409644117
}, 0 );
4409744118

44098-
return cached;
44119+
return;
4409944120

4410044121
}
4410144122

@@ -49545,6 +49566,9 @@ class ImageBitmapLoader extends Loader {
4954549566
* Sets the given loader options. The structure of the object must match the `options` parameter of
4954649567
* [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
4954749568
*
49569+
* Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
49570+
* different options will return the cached result of the first request.
49571+
*
4954849572
* @param {Object} options - The loader options to set.
4954949573
* @return {ImageBitmapLoader} A reference to this image bitmap loader.
4955049574
*/
@@ -49563,7 +49587,6 @@ class ImageBitmapLoader extends Loader {
4956349587
* @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
4956449588
* @param {onProgressCallback} onProgress - Unsupported in this loader.
4956549589
* @param {onErrorCallback} onError - Executed when errors occur.
49566-
* @return {ImageBitmap|undefined} The image bitmap.
4956749590
*/
4956849591
load( url, onLoad, onProgress, onError ) {
4956949592

@@ -49601,8 +49624,6 @@ class ImageBitmapLoader extends Loader {
4960149624

4960249625
scope.manager.itemEnd( url );
4960349626

49604-
return imageBitmap;
49605-
4960649627
}
4960749628

4960849629
} );
@@ -49620,7 +49641,7 @@ class ImageBitmapLoader extends Loader {
4962049641

4962149642
}, 0 );
4962249643

49623-
return cached;
49644+
return;
4962449645

4962549646
}
4962649647

@@ -49645,8 +49666,6 @@ class ImageBitmapLoader extends Loader {
4964549666

4964649667
scope.manager.itemEnd( url );
4964749668

49648-
return imageBitmap;
49649-
4965049669
} ).catch( function ( e ) {
4965149670

4965249671
if ( onError ) onError( e );
@@ -49777,11 +49796,21 @@ class AudioLoader extends Loader {
4977749796
const bufferCopy = buffer.slice( 0 );
4977849797

4977949798
const context = AudioContext.getContext();
49799+
49800+
const decodeUrl = url + '#decode';
49801+
scope.manager.itemStart( decodeUrl ); // prevent loading manager from completing too early, see #33378
49802+
4978049803
context.decodeAudioData( bufferCopy, function ( audioBuffer ) {
4978149804

4978249805
onLoad( audioBuffer );
49806+
scope.manager.itemEnd( decodeUrl );
4978349807

49784-
} ).catch( handleError );
49808+
} ).catch( function ( e ) {
49809+
49810+
handleError( e );
49811+
scope.manager.itemEnd( decodeUrl );
49812+
49813+
} );
4978549814

4978649815
} catch ( e ) {
4978749816

build/three.core.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)