MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / GetInverseTransformMatrix

Method GetInverseTransformMatrix

TSMotor3D.cpp:92–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92Transform3D Motor3D::GetInverseTransformMatrix(void) const
93{
94 float vx2 = v.x * v.x;
95 float vy2 = v.y * v.y;
96 float vz2 = v.z * v.z;
97
98 float A00 = 1.0F - (vy2 + vz2) * 2.0F;
99 float A11 = 1.0F - (vz2 + vx2) * 2.0F;
100 float A22 = 1.0F - (vx2 + vy2) * 2.0F;
101 float A01 = v.x * v.y;
102 float A02 = v.z * v.x;
103 float A12 = v.y * v.z;
104 float A03 = v.y * m.z - v.z * m.y;
105 float A13 = v.z * m.x - v.x * m.z;
106 float A23 = v.x * m.y - v.y * m.x;
107
108 float B01 = v.z * v.w;
109 float B20 = v.y * v.w;
110 float B12 = v.x * v.w;
111 float B03 = m.x * v.w - v.x * m.w;
112 float B13 = m.y * v.w - v.y * m.w;
113 float B23 = m.z * v.w - v.z * m.w;
114
115 return (Transform3D( A00, (A01 + B01) * 2.0F, (A02 - B20) * 2.0F, (A03 - B03) * 2.0F,
116 (A01 - B01) * 2.0F, A11, (A12 + B12) * 2.0F, (A13 - B13) * 2.0F,
117 (A02 + B20) * 2.0F, (A12 - B12) * 2.0F, A22, (A23 - B23) * 2.0F));
118}
119
120void Motor3D::GetTransformMatrices(Transform3D *M, Transform3D *Minv) const
121{

Callers

nothing calls this directly

Calls 1

Transform3DClass · 0.70

Tested by

no test coverage detected