|
@@ -100,6 +100,8 @@ class Object3D extends EventDispatcher {
|
|
|
this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;
|
|
|
this.matrixWorldNeedsUpdate = false;
|
|
|
|
|
|
+ this.matrixWorldAutoUpdate = Object3D.DefaultMatrixWorldAutoUpdate; // checked by the renderer
|
|
|
+
|
|
|
this.layers = new Layers();
|
|
|
this.visible = true;
|
|
|
|
|
@@ -584,7 +586,11 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
|
|
|
|
- children[ i ].updateMatrixWorld( force );
|
|
|
+ if ( children[ i ].matrixWorldAutoUpdate === true || force === true ) {
|
|
|
+
|
|
|
+ children[ i ].updateMatrixWorld( force );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -594,7 +600,7 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
const parent = this.parent;
|
|
|
|
|
|
- if ( updateParents === true && parent !== null ) {
|
|
|
+ if ( updateParents === true && parent !== null && parent.matrixWorldAutoUpdate === true ) {
|
|
|
|
|
|
parent.updateWorldMatrix( true, false );
|
|
|
|
|
@@ -620,7 +626,11 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
|
|
|
|
- children[ i ].updateWorldMatrix( false, true );
|
|
|
+ if ( children[ i ].matrixWorldAutoUpdate === true ) {
|
|
|
+
|
|
|
+ children[ i ].updateWorldMatrix( false, true );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -893,6 +903,8 @@ class Object3D extends EventDispatcher {
|
|
|
this.matrixAutoUpdate = source.matrixAutoUpdate;
|
|
|
this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;
|
|
|
|
|
|
+ this.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;
|
|
|
+
|
|
|
this.layers.mask = source.layers.mask;
|
|
|
this.visible = source.visible;
|
|
|
|
|
@@ -923,5 +935,6 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
Object3D.DefaultUp = /*@__PURE__*/ new Vector3( 0, 1, 0 );
|
|
|
Object3D.DefaultMatrixAutoUpdate = true;
|
|
|
+Object3D.DefaultMatrixWorldAutoUpdate = true;
|
|
|
|
|
|
export { Object3D };
|