Skip to content

Commit 0908ac5

Browse files
committed
Updated builds.
1 parent 937d157 commit 0908ac5

File tree

8 files changed

+238
-42
lines changed

8 files changed

+238
-42
lines changed

build/three.cjs

Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
'use strict';
77

8-
const REVISION = '178';
8+
const REVISION = '179dev';
99

1010
/**
1111
* Represents mouse buttons and interaction types in context of controls.
@@ -43308,6 +43308,13 @@ class LoadingManager {
4330843308
*/
4330943309
this.onError = onError;
4331043310

43311+
/**
43312+
* Used for aborting ongoing requests in loaders using this manager.
43313+
*
43314+
* @type {AbortController}
43315+
*/
43316+
this.abortController = new AbortController();
43317+
4331143318
/**
4331243319
* This should be called by any loader using the manager when the loader
4331343320
* starts loading an item.
@@ -43508,6 +43515,22 @@ class LoadingManager {
4350843515

4350943516
};
4351043517

43518+
/**
43519+
* Can be used to abort ongoing loading requests in loaders using this manager.
43520+
* The abort only works if the loaders implement {@link Loader#abort} and `AbortSignal.any()`
43521+
* is supported in the browser.
43522+
*
43523+
* @return {LoadingManager} A reference to this loading manager.
43524+
*/
43525+
this.abort = function () {
43526+
43527+
this.abortController.abort();
43528+
this.abortController = new AbortController();
43529+
43530+
return this;
43531+
43532+
};
43533+
4351143534
}
4351243535

4351343536
}
@@ -43587,6 +43610,7 @@ class Loader {
4358743610
* This method needs to be implemented by all concrete loaders. It holds the
4358843611
* logic for loading assets from the backend.
4358943612
*
43613+
* @abstract
4359043614
* @param {string} url - The path/URL of the file to be loaded.
4359143615
* @param {Function} onLoad - Executed when the loading process has been finished.
4359243616
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
@@ -43617,6 +43641,7 @@ class Loader {
4361743641
* This method needs to be implemented by all concrete loaders. It holds the
4361843642
* logic for parsing the asset into three.js entities.
4361943643
*
43644+
* @abstract
4362043645
* @param {any} data - The data to parse.
4362143646
*/
4362243647
parse( /* data */ ) {}
@@ -43691,6 +43716,18 @@ class Loader {
4369143716

4369243717
}
4369343718

43719+
/**
43720+
* This method can be implemented in loaders for aborting ongoing requests.
43721+
*
43722+
* @abstract
43723+
* @return {Loader} A reference to this instance.
43724+
*/
43725+
abort() {
43726+
43727+
return this;
43728+
43729+
}
43730+
4369443731
}
4369543732

4369643733
/**
@@ -43773,6 +43810,14 @@ class FileLoader extends Loader {
4377343810
*/
4377443811
this.responseType = '';
4377543812

43813+
/**
43814+
* Used for aborting requests.
43815+
*
43816+
* @private
43817+
* @type {AbortController}
43818+
*/
43819+
this._abortController = new AbortController();
43820+
4377643821
}
4377743822

4377843823
/**
@@ -43839,7 +43884,7 @@ class FileLoader extends Loader {
4383943884
const req = new Request( url, {
4384043885
headers: new Headers( this.requestHeader ),
4384143886
credentials: this.withCredentials ? 'include' : 'same-origin',
43842-
// An abort controller could be added within a future PR
43887+
signal: ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal
4384343888
} );
4384443889

4384543890
// record states ( avoid data race )
@@ -44056,6 +44101,20 @@ class FileLoader extends Loader {
4405644101

4405744102
}
4405844103

44104+
/**
44105+
* Aborts ongoing fetch requests.
44106+
*
44107+
* @return {FileLoader} A reference to this instance.
44108+
*/
44109+
abort() {
44110+
44111+
this._abortController.abort();
44112+
this._abortController = new AbortController();
44113+
44114+
return this;
44115+
44116+
}
44117+
4405944118
}
4406044119

4406144120
/**
@@ -48655,6 +48714,14 @@ class ImageBitmapLoader extends Loader {
4865548714
*/
4865648715
this.options = { premultiplyAlpha: 'none' };
4865748716

48717+
/**
48718+
* Used for aborting requests.
48719+
*
48720+
* @private
48721+
* @type {AbortController}
48722+
*/
48723+
this._abortController = new AbortController();
48724+
4865848725
}
4865948726

4866048727
/**
@@ -48743,6 +48810,7 @@ class ImageBitmapLoader extends Loader {
4874348810
const fetchOptions = {};
4874448811
fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
4874548812
fetchOptions.headers = this.requestHeader;
48813+
fetchOptions.signal = ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal;
4874648814

4874748815
const promise = fetch( url, fetchOptions ).then( function ( res ) {
4874848816

@@ -48780,6 +48848,20 @@ class ImageBitmapLoader extends Loader {
4878048848

4878148849
}
4878248850

48851+
/**
48852+
* Aborts ongoing fetch requests.
48853+
*
48854+
* @return {ImageBitmapLoader} A reference to this instance.
48855+
*/
48856+
abort() {
48857+
48858+
this._abortController.abort();
48859+
this._abortController = new AbortController();
48860+
48861+
return this;
48862+
48863+
}
48864+
4878348865
}
4878448866

4878548867
let _context;
@@ -56747,34 +56829,34 @@ class CameraHelper extends LineSegments {
5674756829

5674856830
// near
5674956831

56750-
setPoint( 'n1', pointMap, geometry, _camera, - w, - h, nearZ );
56751-
setPoint( 'n2', pointMap, geometry, _camera, w, - h, nearZ );
56752-
setPoint( 'n3', pointMap, geometry, _camera, - w, h, nearZ );
56832+
setPoint( 'n1', pointMap, geometry, _camera, -1, -1, nearZ );
56833+
setPoint( 'n2', pointMap, geometry, _camera, w, -1, nearZ );
56834+
setPoint( 'n3', pointMap, geometry, _camera, -1, h, nearZ );
5675356835
setPoint( 'n4', pointMap, geometry, _camera, w, h, nearZ );
5675456836

5675556837
// far
5675656838

56757-
setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 );
56758-
setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 );
56759-
setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 );
56839+
setPoint( 'f1', pointMap, geometry, _camera, -1, -1, 1 );
56840+
setPoint( 'f2', pointMap, geometry, _camera, w, -1, 1 );
56841+
setPoint( 'f3', pointMap, geometry, _camera, -1, h, 1 );
5676056842
setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 );
5676156843

5676256844
// up
5676356845

5676456846
setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, nearZ );
56765-
setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, nearZ );
56847+
setPoint( 'u2', pointMap, geometry, _camera, -1 * 0.7, h * 1.1, nearZ );
5676656848
setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, nearZ );
5676756849

5676856850
// cross
5676956851

56770-
setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 );
56852+
setPoint( 'cf1', pointMap, geometry, _camera, -1, 0, 1 );
5677156853
setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 );
56772-
setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 );
56854+
setPoint( 'cf3', pointMap, geometry, _camera, 0, -1, 1 );
5677356855
setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 );
5677456856

56775-
setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, nearZ );
56857+
setPoint( 'cn1', pointMap, geometry, _camera, -1, 0, nearZ );
5677656858
setPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );
56777-
setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, nearZ );
56859+
setPoint( 'cn3', pointMap, geometry, _camera, 0, -1, nearZ );
5677856860
setPoint( 'cn4', pointMap, geometry, _camera, 0, h, nearZ );
5677956861

5678056862
geometry.getAttribute( 'position' ).needsUpdate = true;

0 commit comments

Comments
 (0)