MCPcopy
hub / github.com/mrdoob/three.js / updateMatrixWorld

Method updateMatrixWorld

src/core/Object3D.js:1165–1203  ·  view source on GitHub ↗

* Updates the transformation matrix in world space of this 3D objects and its descendants. * * To ensure correct results, this method also recomputes the 3D object's transformation matrix in * local space. The computation of the local and world matrix can be controlled with the * {@link Obje

( force )

Source from the content-addressed store, hash-verified

1163 * when {@link Object3D#matrixWorldNeedsUpdate} is `false`.
1164 */
1165 updateMatrixWorld( force ) {
1166
1167 if ( this.matrixAutoUpdate ) this.updateMatrix();
1168
1169 if ( this.matrixWorldNeedsUpdate || force ) {
1170
1171 if ( this.matrixWorldAutoUpdate === true ) {
1172
1173 if ( this.parent === null ) {
1174
1175 this.matrixWorld.copy( this.matrix );
1176
1177 } else {
1178
1179 this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
1180
1181 }
1182
1183 }
1184
1185 this.matrixWorldNeedsUpdate = false;
1186
1187 force = true;
1188
1189 }
1190
1191 // make sure descendants are updated if required
1192
1193 const children = this.children;
1194
1195 for ( let i = 0, l = children.length; i < l; i ++ ) {
1196
1197 const child = children[ i ];
1198
1199 child.updateMatrixWorld( force );
1200
1201 }
1202
1203 }
1204
1205 /**
1206 * An alternative version of {@link Object3D#updateMatrixWorld} with more control over the

Callers

nothing calls this directly

Calls 3

updateMatrixMethod · 0.95
copyMethod · 0.45
multiplyMatricesMethod · 0.45

Tested by

no test coverage detected