Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 32 additions & 149 deletions build/three.cjs

Large diffs are not rendered by default.

182 changes: 33 additions & 149 deletions build/three.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.module.min.js

Large diffs are not rendered by default.

29 changes: 16 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/animation/PropertyBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ class PropertyBinding {
}

this.targetObject.matrixWorldNeedsUpdate = true;
this.targetObject.matrixNeedsUpdate = true;

}

Expand All @@ -373,7 +372,6 @@ class PropertyBinding {

this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];
this.targetObject.matrixWorldNeedsUpdate = true;
this.targetObject.matrixNeedsUpdate = true;

}

Expand All @@ -396,7 +394,6 @@ class PropertyBinding {

this.resolvedProperty.fromArray( buffer, offset );
this.targetObject.matrixWorldNeedsUpdate = true;
this.targetObject.matrixNeedsUpdate = true;

}

Expand Down
33 changes: 0 additions & 33 deletions src/audio/PositionalAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@ class PositionalAudio extends Audio {

super.updateMatrixWorld( force );

let setInitial = false;

if ( ! this._lastPosition ) {

setInitial = true;
this._lastPosition = new Vector3();
this._lastOrientation = new Vector3();

}

if ( this.hasPlaybackControl === true && this.isPlaying === false ) return;

this.matrixWorld.decompose( _position, _quaternion, _scale );
Expand All @@ -129,21 +119,6 @@ class PositionalAudio extends Audio {

const panner = this.panner;

// Only apply changes to the pannernode if position or orientation have changed.
if (
! setInitial &&
Math.abs( _position.x - this._lastPosition.x ) < Number.EPSILON &&
Math.abs( _position.y - this._lastPosition.y ) < Number.EPSILON &&
Math.abs( _position.z - this._lastPosition.z ) < Number.EPSILON &&
Math.abs( _orientation.x - this._lastOrientation.x ) < Number.EPSILON &&
Math.abs( _orientation.y - this._lastOrientation.y ) < Number.EPSILON &&
Math.abs( _orientation.z - this._lastOrientation.z ) < Number.EPSILON
) {

return;

}

if ( panner.positionX ) {

// code path for Chrome and Firefox (see #14393)
Expand All @@ -164,14 +139,6 @@ class PositionalAudio extends Audio {

}

this._lastPosition.x = _position.x;
this._lastPosition.y = _position.y;
this._lastPosition.z = _position.z;

this._lastOrientation.x = _orientation.x;
this._lastOrientation.y = _orientation.y;
this._lastOrientation.z = _orientation.z;

}

}
Expand Down
3 changes: 0 additions & 3 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@ export const ReinhardToneMapping = 2;
export const CineonToneMapping = 3;
export const ACESFilmicToneMapping = 4;
export const CustomToneMapping = 5;

export const AgXToneMapping = 6;
export const NeutralToneMapping = 7;
export const AttachedBindMode = 'attached';
export const DetachedBindMode = 'detached';

export const LUTToneMapping = 6;

export const UVMapping = 300;
export const CubeReflectionMapping = 301;
export const CubeRefractionMapping = 302;
Expand Down
18 changes: 9 additions & 9 deletions src/core/Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
const _identity = new Matrix4();
_identity.identity();

const _epsilon = 0.00000000001;

Check warning on line 39 in src/core/Object3D.js

View workflow job for this annotation

GitHub Actions / Lint testing

'_epsilon' is assigned a value but never used

class Object3D extends EventDispatcher {

Expand Down Expand Up @@ -328,15 +328,15 @@

}

if ( _q2.near( this.quaternion, _epsilon ) ) {
//if ( _q2.near( this.quaternion, _epsilon ) ) {

this.quaternion.copy( _q2 );
// this.quaternion.copy( _q2 );

} else {
//} else {

this.matrixNeedsUpdate = true;

Check failure on line 337 in src/core/Object3D.js

View workflow job for this annotation

GitHub Actions / Lint testing

Expected indentation of 2 tabs but found 3

}
//}

}

Expand Down Expand Up @@ -774,15 +774,15 @@

}

if ( _m2.near( this.matrixWorld, _epsilon ) ) {
// if ( _m2.near( this.matrixWorld, _epsilon ) ) {

this.matrixWorld.copy( _m2 );
// this.matrixWorld.copy( _m2 );

} else {
// } else {

this.childrenNeedMatrixWorldUpdate = true;
this.childrenNeedMatrixWorldUpdate = true;

Check failure on line 783 in src/core/Object3D.js

View workflow job for this annotation

GitHub Actions / Lint testing

Expected indentation of 3 tabs but found 0

}
// }

this.matrixWorldNeedsUpdate = false;

Expand Down
4 changes: 3 additions & 1 deletion src/core/Raycaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ function intersect( object, raycaster, intersects, recursive ) {

let propagate = true;

if ( ! object.visible ) return;
if ( object.layers.test( raycaster.layers ) ) {

const result = object.raycast( raycaster, intersects );

if ( result === false ) propagate = false;

}

if ( propagate === true && recursive === true ) {

const children = object.children;
Expand Down
33 changes: 12 additions & 21 deletions src/loaders/FileLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ class FileLoader extends Loader {

url = this.manager.resolveURL( url );

const isRangeRequest = this.requestHeader.Range !== undefined;
const key = url + ( isRangeRequest ? `:${this.requestHeader.Range}` : '' );

const cached = Cache.get( key );
const cached = Cache.get( url );

if ( cached !== undefined ) {

Expand All @@ -53,9 +50,9 @@ class FileLoader extends Loader {

// Check if request is duplicate

if ( loading[ key ] !== undefined ) {
if ( loading[ url ] !== undefined ) {

loading[ key ].push( {
loading[ url ].push( {

onLoad: onLoad,
onProgress: onProgress,
Expand All @@ -68,9 +65,9 @@ class FileLoader extends Loader {
}

// Initialise array for duplicate requests
loading[ key ] = [];
loading[ url ] = [];

loading[ key ].push( {
loading[ url ].push( {
onLoad: onLoad,
onProgress: onProgress,
onError: onError,
Expand All @@ -91,7 +88,7 @@ class FileLoader extends Loader {
fetch( req )
.then( response => {

if ( response.status === 200 || response.status === 206 || response.status === 0 ) {
if ( response.status === 200 || response.status === 0 ) {

// Some browsers return HTTP Status 0 when using non-http protocol
// e.g. 'file://' or 'data://'. Handle as success.
Expand All @@ -102,12 +99,6 @@ class FileLoader extends Loader {

}

if ( isRangeRequest && response.status === 200 ) {

throw new HttpError( `range request fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`, response );

}

// Workaround: Checking if response.body === undefined for Alipay browser #23548

if ( typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined ) {
Expand All @@ -116,7 +107,7 @@ class FileLoader extends Loader {

}

const callbacks = loading[ key ];
const callbacks = loading[ url ];
const reader = response.body.getReader();

// Nginx needs X-File-Size check
Expand Down Expand Up @@ -228,10 +219,10 @@ class FileLoader extends Loader {

// Add to cache only on HTTP success, so that we do not cache
// error response bodies as proper responses to requests.
Cache.add( key, data );
Cache.add( url, data );

const callbacks = loading[ key ];
delete loading[ key ];
const callbacks = loading[ url ];
delete loading[ url ];

for ( let i = 0, il = callbacks.length; i < il; i ++ ) {

Expand All @@ -245,7 +236,7 @@ class FileLoader extends Loader {

// Abort errors and other errors are handled the same

const callbacks = loading[ key ];
const callbacks = loading[ url ];

if ( callbacks === undefined ) {

Expand All @@ -255,7 +246,7 @@ class FileLoader extends Loader {

}

delete loading[ key ];
delete loading[ url ];

for ( let i = 0, il = callbacks.length; i < il; i ++ ) {

Expand Down
Loading
Loading