summaryrefslogtreecommitdiffstats
path: root/src/math/Matrix.h
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2019-10-23 23:45:16 +0200
committerGitHub <noreply@github.com>2019-10-23 23:45:16 +0200
commitd61430fbba8436fb93408995c7961929ee67fc77 (patch)
treedbc6880cd876a735209c7c3daa9a912a6a0e9dcf /src/math/Matrix.h
parentMerge pull request #252 from Sergeanur/MessagesPagerText (diff)
parentChanged math functions (diff)
downloadre3-d61430fbba8436fb93408995c7961929ee67fc77.tar
re3-d61430fbba8436fb93408995c7961929ee67fc77.tar.gz
re3-d61430fbba8436fb93408995c7961929ee67fc77.tar.bz2
re3-d61430fbba8436fb93408995c7961929ee67fc77.tar.lz
re3-d61430fbba8436fb93408995c7961929ee67fc77.tar.xz
re3-d61430fbba8436fb93408995c7961929ee67fc77.tar.zst
re3-d61430fbba8436fb93408995c7961929ee67fc77.zip
Diffstat (limited to 'src/math/Matrix.h')
-rw-r--r--src/math/Matrix.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h
index b4a866a0..96f56a0f 100644
--- a/src/math/Matrix.h
+++ b/src/math/Matrix.h
@@ -127,20 +127,14 @@ public:
}
void Scale(float scale)
{
- // GTA treats this as 4x4 floats
- m_matrix.right.x *= scale;
- m_matrix.right.y *= scale;
- m_matrix.right.z *= scale;
- m_matrix.up.x *= scale;
- m_matrix.up.y *= scale;
- m_matrix.up.z *= scale;
- m_matrix.at.x *= scale;
- m_matrix.at.y *= scale;
- m_matrix.at.z *= scale;
- m_matrix.pos.x *= scale;
- m_matrix.pos.y *= scale;
- m_matrix.pos.z *= scale;
- m_matrix.flags = 0;
+ float *pFloatMatrix = (float*)&m_matrix;
+ for (int i = 0; i < 3; i++)
+#ifdef FIX_BUGS // BUGFIX from VC
+ for (int j = 0; j < 3; j++)
+#else
+ for (int j = 0; j < 4; j++)
+#endif
+ pFloatMatrix[i * 4 + j] *= scale;
}