Re-order variables in salInvertMatrix to match declaration order

Former-commit-id: a86f8e4343
This commit is contained in:
Phillip Stephens 2023-02-24 21:12:33 -08:00
parent 40820d5a56
commit c15fd665db
1 changed files with 12 additions and 12 deletions

View File

@ -28,18 +28,18 @@ void salInvertMatrix(SND_FMATRIX* out, const SND_FMATRIX* in) {
float f; // r63
a = in->m[1][1] * in->m[2][2] - in->m[2][1] * in->m[1][2];
c = -(in->m[1][0] * in->m[2][2] - in->m[2][0] * in->m[1][2]);
f = in->m[1][0] * in->m[2][1] - in->m[2][0] * in->m[1][1];
b = 1.f / (in->m[0][0] * a + in->m[0][1] * c + in->m[0][2] * f);
out->m[0][0] = b * a;
out->m[1][0] = b * c;
out->m[2][0] = b * f;
out->m[0][1] = -b * (in->m[0][1] * in->m[2][2] - in->m[2][1] * in->m[0][2]);
out->m[1][1] = b * (in->m[0][0] * in->m[2][2] - in->m[2][0] * in->m[0][2]);
out->m[2][1] = -b * (in->m[0][0] * in->m[2][1] - in->m[2][0] * in->m[0][1]);
out->m[0][2] = b * (in->m[0][1] * in->m[1][2] - in->m[1][1] * in->m[0][2]);
out->m[1][2] = -b * (in->m[0][0] * in->m[1][2] - in->m[1][0] * in->m[0][2]);
out->m[2][2] = b * (in->m[0][0] * in->m[1][1] - in->m[1][0] * in->m[0][1]);
b = -(in->m[1][0] * in->m[2][2] - in->m[2][0] * in->m[1][2]);
c = in->m[1][0] * in->m[2][1] - in->m[2][0] * in->m[1][1];
f = 1.f / (in->m[0][0] * a + in->m[0][1] * b + in->m[0][2] * c);
out->m[0][0] = f * a;
out->m[1][0] = f * b;
out->m[2][0] = f * c;
out->m[0][1] = -f * (in->m[0][1] * in->m[2][2] - in->m[2][1] * in->m[0][2]);
out->m[1][1] = f * (in->m[0][0] * in->m[2][2] - in->m[2][0] * in->m[0][2]);
out->m[2][1] = -f * (in->m[0][0] * in->m[2][1] - in->m[2][0] * in->m[0][1]);
out->m[0][2] = f * (in->m[0][1] * in->m[1][2] - in->m[1][1] * in->m[0][2]);
out->m[1][2] = -f * (in->m[0][0] * in->m[1][2] - in->m[1][0] * in->m[0][2]);
out->m[2][2] = f * (in->m[0][0] * in->m[1][1] - in->m[1][0] * in->m[0][1]);
out->t[0] = (-in->t[0] * out->m[0][0] - in->t[1] * out->m[0][1]) - in->t[2] * out->m[0][2];
out->t[1] = (-in->t[0] * out->m[1][0] - in->t[1] * out->m[1][1]) - in->t[2] * out->m[1][2];
out->t[2] = (-in->t[0] * out->m[2][0] - in->t[1] * out->m[2][1]) - in->t[2] * out->m[2][2];