Skip to content
Merged
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
43 changes: 31 additions & 12 deletions build/three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12889,8 +12889,10 @@ class Object3D extends EventDispatcher {
*
* @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.
* @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.
* @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even
* when {@link Object3D#matrixWorldNeedsUpdate} is `false`.
*/
updateWorldMatrix( updateParents, updateChildren ) {
updateWorldMatrix( updateParents, updateChildren, force = false ) {

const parent = this.parent;

Expand All @@ -12902,18 +12904,26 @@ class Object3D extends EventDispatcher {

if ( this.matrixAutoUpdate ) this.updateMatrix();

if ( this.matrixWorldAutoUpdate === true ) {
if ( this.matrixWorldNeedsUpdate || force ) {

if ( this.parent === null ) {
if ( this.matrixWorldAutoUpdate === true ) {

this.matrixWorld.copy( this.matrix );
if ( this.parent === null ) {

} else {
this.matrixWorld.copy( this.matrix );

} else {

this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );

}

}

this.matrixWorldNeedsUpdate = false;

force = true;

}

// make sure descendants are updated
Expand All @@ -12926,7 +12936,7 @@ class Object3D extends EventDispatcher {

const child = children[ i ];

child.updateWorldMatrix( false, true );
child.updateWorldMatrix( false, true, force );

}

Expand Down Expand Up @@ -46169,9 +46179,9 @@ class Camera extends Object3D {

}

updateWorldMatrix( updateParents, updateChildren ) {
updateWorldMatrix( updateParents, updateChildren, force = false ) {

super.updateWorldMatrix( updateParents, updateChildren );
super.updateWorldMatrix( updateParents, updateChildren, force );

// exclude scale from view matrix to be glTF conform

Expand Down Expand Up @@ -50212,8 +50222,11 @@ class StereoCamera {

}

this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );
this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );
this.cameraL.matrix.copy( camera.matrixWorld ).multiply( _eyeLeft );
this.cameraL.matrixWorldNeedsUpdate = true;

this.cameraR.matrix.copy( camera.matrixWorld ).multiply( _eyeRight );
this.cameraR.matrixWorldNeedsUpdate = true;

}

Expand Down Expand Up @@ -57524,7 +57537,7 @@ class SpotLightHelper extends Object3D {

}

this.matrixWorld.copy( this.light.matrixWorld );
this.matrixWorldNeedsUpdate = true;

const coneLength = this.light.distance ? this.light.distance : 1000;
const coneWidth = coneLength * Math.tan( this.light.angle );
Expand Down Expand Up @@ -57807,6 +57820,8 @@ class PointLightHelper extends Mesh {
*/
update() {

this.matrixWorldNeedsUpdate = true;

this.light.updateWorldMatrix( true, false );

if ( this.color !== undefined ) {
Expand Down Expand Up @@ -57950,6 +57965,8 @@ class HemisphereLightHelper extends Object3D {

}

this.matrixWorldNeedsUpdate = true;

this.light.updateWorldMatrix( true, false );

mesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );
Expand Down Expand Up @@ -58261,6 +58278,8 @@ class DirectionalLightHelper extends Object3D {
*/
update() {

this.matrixWorldNeedsUpdate = true;

this.light.updateWorldMatrix( true, false );
this.light.target.updateWorldMatrix( true, false );

Expand Down
43 changes: 31 additions & 12 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -12909,8 +12909,10 @@ class Object3D extends EventDispatcher {
*
* @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.
* @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.
* @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even
* when {@link Object3D#matrixWorldNeedsUpdate} is `false`.
*/
updateWorldMatrix( updateParents, updateChildren ) {
updateWorldMatrix( updateParents, updateChildren, force = false ) {

const parent = this.parent;

Expand All @@ -12922,18 +12924,26 @@ class Object3D extends EventDispatcher {

if ( this.matrixAutoUpdate ) this.updateMatrix();

if ( this.matrixWorldAutoUpdate === true ) {
if ( this.matrixWorldNeedsUpdate || force ) {

if ( this.parent === null ) {
if ( this.matrixWorldAutoUpdate === true ) {

this.matrixWorld.copy( this.matrix );
if ( this.parent === null ) {

} else {
this.matrixWorld.copy( this.matrix );

} else {

this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );

}

}

this.matrixWorldNeedsUpdate = false;

force = true;

}

// make sure descendants are updated
Expand All @@ -12946,7 +12956,7 @@ class Object3D extends EventDispatcher {

const child = children[ i ];

child.updateWorldMatrix( false, true );
child.updateWorldMatrix( false, true, force );

}

Expand Down Expand Up @@ -46189,9 +46199,9 @@ class Camera extends Object3D {

}

updateWorldMatrix( updateParents, updateChildren ) {
updateWorldMatrix( updateParents, updateChildren, force = false ) {

super.updateWorldMatrix( updateParents, updateChildren );
super.updateWorldMatrix( updateParents, updateChildren, force );

// exclude scale from view matrix to be glTF conform

Expand Down Expand Up @@ -50232,8 +50242,11 @@ class StereoCamera {

}

this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );
this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );
this.cameraL.matrix.copy( camera.matrixWorld ).multiply( _eyeLeft );
this.cameraL.matrixWorldNeedsUpdate = true;

this.cameraR.matrix.copy( camera.matrixWorld ).multiply( _eyeRight );
this.cameraR.matrixWorldNeedsUpdate = true;

}

Expand Down Expand Up @@ -57544,7 +57557,7 @@ class SpotLightHelper extends Object3D {

}

this.matrixWorld.copy( this.light.matrixWorld );
this.matrixWorldNeedsUpdate = true;

const coneLength = this.light.distance ? this.light.distance : 1000;
const coneWidth = coneLength * Math.tan( this.light.angle );
Expand Down Expand Up @@ -57827,6 +57840,8 @@ class PointLightHelper extends Mesh {
*/
update() {

this.matrixWorldNeedsUpdate = true;

this.light.updateWorldMatrix( true, false );

if ( this.color !== undefined ) {
Expand Down Expand Up @@ -57970,6 +57985,8 @@ class HemisphereLightHelper extends Object3D {

}

this.matrixWorldNeedsUpdate = true;

this.light.updateWorldMatrix( true, false );

mesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );
Expand Down Expand Up @@ -58281,6 +58298,8 @@ class DirectionalLightHelper extends Object3D {
*/
update() {

this.matrixWorldNeedsUpdate = true;

this.light.updateWorldMatrix( true, false );
this.light.target.updateWorldMatrix( true, false );

Expand Down
2 changes: 1 addition & 1 deletion build/three.core.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion build/three.tsl.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Loading
Loading