MCPcopy Index your code
hub / github.com/mrdoob/three.js / setFromMatrixScale

Method setFromMatrixScale

src/math/Vector3.js:1075–1087  ·  view source on GitHub ↗

* Sets the vector components to the scale elements of the * given transformation matrix. * * @param {Matrix4} m - The 4x4 matrix. * @return {Vector3} A reference to this vector.

( m )

Source from the content-addressed store, hash-verified

1073 * @return {Vector3} A reference to this vector.
1074 */
1075 setFromMatrixScale( m ) {
1076
1077 const sx = this.setFromMatrixColumn( m, 0 ).length();
1078 const sy = this.setFromMatrixColumn( m, 1 ).length();
1079 const sz = this.setFromMatrixColumn( m, 2 ).length();
1080
1081 this.x = sx;
1082 this.y = sy;
1083 this.z = sz;
1084
1085 return this;
1086
1087 }
1088
1089 /**
1090 * Sets the vector components from the specified matrix column.

Callers 5

retargetFunction · 0.95
Vector3.tests.jsFile · 0.80
raycastMethod · 0.80
updateMethod · 0.80
generateTransformFunction · 0.80

Calls 2

setFromMatrixColumnMethod · 0.95
lengthMethod · 0.45

Tested by

no test coverage detected