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

Method _getRotationMatrix

docs/app/js/sanddance-app.js:75850–75972  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

75848 return this;
75849 }
75850 _getRotationMatrix(result) {
75851 const te = result || [
75852 -0,
75853 -0,
75854 -0,
75855 -0,
75856 -0,
75857 -0,
75858 -0,
75859 -0,
75860 -0,
75861 -0,
75862 -0,
75863 -0,
75864 -0,
75865 -0,
75866 -0,
75867 -0
75868 ];
75869 const x = this.x, y = this.y, z = this.z;
75870 const a = Math.cos(x);
75871 const c = Math.cos(y);
75872 const e = Math.cos(z);
75873 const b = Math.sin(x);
75874 const d = Math.sin(y);
75875 const f = Math.sin(z);
75876 switch(this[3]){
75877 case Euler.XYZ:
75878 {
75879 const ae = a * e, af = a * f, be = b * e, bf = b * f;
75880 te[0] = c * e;
75881 te[4] = -c * f;
75882 te[8] = d;
75883 te[1] = af + be * d;
75884 te[5] = ae - bf * d;
75885 te[9] = -b * c;
75886 te[2] = bf - ae * d;
75887 te[6] = be + af * d;
75888 te[10] = a * c;
75889 break;
75890 }
75891 case Euler.YXZ:
75892 {
75893 const ce = c * e, cf = c * f, de = d * e, df = d * f;
75894 te[0] = ce + df * b;
75895 te[4] = de * b - cf;
75896 te[8] = a * d;
75897 te[1] = a * f;
75898 te[5] = a * e;
75899 te[9] = -b;
75900 te[2] = cf * b - de;
75901 te[6] = df + ce * b;
75902 te[10] = a * c;
75903 break;
75904 }
75905 case Euler.ZXY:
75906 {
75907 const ce = c * e, cf = c * f, de = d * e, df = d * f;

Callers 1

getRotationMatrixMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected