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

Method updateMatrix

src/core/Object3D.js:1133–1152  ·  view source on GitHub ↗

* Updates the transformation matrix in local space by computing it from the current * position, rotation and scale values.

()

Source from the content-addressed store, hash-verified

1131 * position, rotation and scale values.
1132 */
1133 updateMatrix() {
1134
1135 this.matrix.compose( this.position, this.quaternion, this.scale );
1136
1137 const pivot = this.pivot;
1138
1139 if ( pivot !== null ) {
1140
1141 const px = pivot.x, py = pivot.y, pz = pivot.z;
1142 const te = this.matrix.elements;
1143
1144 te[ 12 ] += px - te[ 0 ] * px - te[ 4 ] * py - te[ 8 ] * pz;
1145 te[ 13 ] += py - te[ 1 ] * px - te[ 5 ] * py - te[ 9 ] * pz;
1146 te[ 14 ] += pz - te[ 2 ] * px - te[ 6 ] * py - te[ 10 ] * pz;
1147
1148 }
1149
1150 this.matrixWorldNeedsUpdate = true;
1151
1152 }
1153
1154 /**
1155 * Updates the transformation matrix in world space of this 3D objects and its descendants.

Callers 15

applyMatrix4Method · 0.95
updateMatrixWorldMethod · 0.95
updateWorldMatrixMethod · 0.95
constructorMethod · 0.95
buildMethod · 0.95
Object3D.tests.jsFile · 0.45
Editor.jsFile · 0.45
lookAtMethod · 0.45
setLengthMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45

Calls 1

composeMethod · 0.45

Tested by

no test coverage detected