|
@@ -5828,6 +5828,8 @@ class Object3D extends EventDispatcher {
|
|
|
this.matrixWorld = new Matrix4();
|
|
|
this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;
|
|
|
this.matrixWorldNeedsUpdate = false;
|
|
|
+ this.matrixWorldAutoUpdate = Object3D.DefaultMatrixWorldAutoUpdate; // checked by the renderer
|
|
|
+
|
|
|
this.layers = new Layers();
|
|
|
this.visible = true;
|
|
|
this.castShadow = false;
|
|
@@ -6150,14 +6152,18 @@ class Object3D extends EventDispatcher {
|
|
|
const children = this.children;
|
|
|
|
|
|
for (let i = 0, l = children.length; i < l; i++) {
|
|
|
- children[i].updateMatrixWorld(force);
|
|
|
+ const child = children[i];
|
|
|
+
|
|
|
+ if (child.matrixWorldAutoUpdate === true || force === true) {
|
|
|
+ child.updateMatrixWorld(force);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
updateWorldMatrix(updateParents, updateChildren) {
|
|
|
const parent = this.parent;
|
|
|
|
|
|
- if (updateParents === true && parent !== null) {
|
|
|
+ if (updateParents === true && parent !== null && parent.matrixWorldAutoUpdate === true) {
|
|
|
parent.updateWorldMatrix(true, false);
|
|
|
}
|
|
|
|
|
@@ -6174,7 +6180,11 @@ class Object3D extends EventDispatcher {
|
|
|
const children = this.children;
|
|
|
|
|
|
for (let i = 0, l = children.length; i < l; i++) {
|
|
|
- children[i].updateWorldMatrix(false, true);
|
|
|
+ const child = children[i];
|
|
|
+
|
|
|
+ if (child.matrixWorldAutoUpdate === true) {
|
|
|
+ child.updateWorldMatrix(false, true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -6361,6 +6371,7 @@ class Object3D extends EventDispatcher {
|
|
|
this.matrixWorld.copy(source.matrixWorld);
|
|
|
this.matrixAutoUpdate = source.matrixAutoUpdate;
|
|
|
this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;
|
|
|
+ this.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;
|
|
|
this.layers.mask = source.layers.mask;
|
|
|
this.visible = source.visible;
|
|
|
this.castShadow = source.castShadow;
|
|
@@ -6383,6 +6394,7 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
Object3D.DefaultUp = /*@__PURE__*/new Vector3(0, 1, 0);
|
|
|
Object3D.DefaultMatrixAutoUpdate = true;
|
|
|
+Object3D.DefaultMatrixWorldAutoUpdate = true;
|
|
|
|
|
|
const _v0$1 = /*@__PURE__*/new Vector3();
|
|
|
|
|
@@ -20093,9 +20105,9 @@ function WebGLRenderer(parameters = {}) {
|
|
|
|
|
|
if (_isContextLost === true) return; // update scene graph
|
|
|
|
|
|
- if (scene.autoUpdate === true) scene.updateMatrixWorld(); // update camera matrices and frustum
|
|
|
+ if (scene.matrixWorldAutoUpdate === true) scene.updateMatrixWorld(); // update camera matrices and frustum
|
|
|
|
|
|
- if (camera.parent === null) camera.updateMatrixWorld();
|
|
|
+ if (camera.parent === null && camera.matrixWorldAutoUpdate === true) camera.updateMatrixWorld();
|
|
|
|
|
|
if (xr.enabled === true && xr.isPresenting === true) {
|
|
|
if (xr.cameraAutoUpdate === true) xr.updateCamera(camera);
|
|
@@ -21050,7 +21062,6 @@ class Scene extends Object3D {
|
|
|
this.environment = null;
|
|
|
this.fog = null;
|
|
|
this.overrideMaterial = null;
|
|
|
- this.autoUpdate = true; // checked by the renderer
|
|
|
|
|
|
if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
|
|
|
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {
|
|
@@ -21065,7 +21076,6 @@ class Scene extends Object3D {
|
|
|
if (source.environment !== null) this.environment = source.environment.clone();
|
|
|
if (source.fog !== null) this.fog = source.fog.clone();
|
|
|
if (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone();
|
|
|
- this.autoUpdate = source.autoUpdate;
|
|
|
this.matrixAutoUpdate = source.matrixAutoUpdate;
|
|
|
return this;
|
|
|
}
|
|
@@ -35542,7 +35552,20 @@ class TubeBufferGeometry extends TubeGeometry {
|
|
|
super(path, tubularSegments, radius, radialSegments, closed);
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+} // r144
|
|
|
+
|
|
|
+Object.defineProperty(Scene.prototype, 'autoUpdate', {
|
|
|
+ get() {
|
|
|
+ console.warn('THREE.Scene: autoUpdate has been renamed matrixWorldAutoUpdate.');
|
|
|
+ return this.matrixWorldAutoUpdate;
|
|
|
+ },
|
|
|
+
|
|
|
+ set(value) {
|
|
|
+ console.warn('THREE.Scene: autoUpdate has been renamed matrixWorldAutoUpdate.');
|
|
|
+ this.matrixWorldAutoUpdate = value;
|
|
|
+ }
|
|
|
+
|
|
|
+});
|
|
|
|
|
|
if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
|
|
|
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {
|