|
@@ -1208,8 +1208,10 @@ class Object3D extends EventDispatcher {
|
|
|
*
|
|
*
|
|
|
* @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.
|
|
* @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} [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;
|
|
const parent = this.parent;
|
|
|
|
|
|
|
@@ -1221,18 +1223,26 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
|
|
if ( this.matrixAutoUpdate ) this.updateMatrix();
|
|
if ( this.matrixAutoUpdate ) this.updateMatrix();
|
|
|
|
|
|
|
|
- if ( this.matrixWorldAutoUpdate === true ) {
|
|
|
|
|
|
|
+ if ( this.matrixWorldNeedsUpdate || force ) {
|
|
|
|
|
+
|
|
|
|
|
+ if ( this.matrixWorldAutoUpdate === true ) {
|
|
|
|
|
|
|
|
- if ( this.parent === null ) {
|
|
|
|
|
|
|
+ if ( this.parent === null ) {
|
|
|
|
|
|
|
|
- this.matrixWorld.copy( this.matrix );
|
|
|
|
|
|
|
+ this.matrixWorld.copy( this.matrix );
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ } 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
|
|
// make sure descendants are updated
|
|
@@ -1245,7 +1255,7 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
|
|
const child = children[ i ];
|
|
const child = children[ i ];
|
|
|
|
|
|
|
|
- child.updateWorldMatrix( false, true );
|
|
|
|
|
|
|
+ child.updateWorldMatrix( false, true, force );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|