* Updates the transformation matrix in local space by computing it from the current * position, rotation and scale values.
()
| 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. |
no test coverage detected