MCPcopy Create free account
hub / github.com/microsoft/SandDance / getTransformationMatrix

Method getTransformationMatrix

docs/app/js/sanddance-app.js:75526–75534  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75524 return this.position.exactEquals(pose.position) && this.orientation.exactEquals(pose.orientation);
75525 }
75526 getTransformationMatrix() {
75527 const sr = Math.sin(this.roll);
75528 const sp = Math.sin(this.pitch);
75529 const sw = Math.sin(this.yaw);
75530 const cr = Math.cos(this.roll);
75531 const cp = Math.cos(this.pitch);
75532 const cw = Math.cos(this.yaw);
75533 return new (0, _matrix4Default.default)().setRowMajor(cw * cp, -sw * cr + cw * sp * sr, sw * sr + cw * sp * cr, this.x, sw * cp, cw * cr + sw * sp * sr, -cw * sr + sw * sp * cr, this.y, -sp, cp * sr, cp * cr, this.z, 0, 0, 0, 1);
75534 }
75535 getTransformationMatrixFromPose(pose) {
75536 return new (0, _matrix4Default.default)().multiplyRight(this.getTransformationMatrix()).multiplyRight(pose.getTransformationMatrix().invert());
75537 }

Calls 1

setRowMajorMethod · 0.45

Tested by

no test coverage detected