diff options
author | aap <aap@papnet.eu> | 2020-05-31 17:05:49 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-31 17:05:59 +0200 |
commit | 21ce0a4b28a1842dad91433362d250089ec491b8 (patch) | |
tree | 8c661c49f994d95de6997e0bf4f71cb0ab41dd05 /src/math | |
parent | some more CAutomobile (diff) | |
download | re3-21ce0a4b28a1842dad91433362d250089ec491b8.tar re3-21ce0a4b28a1842dad91433362d250089ec491b8.tar.gz re3-21ce0a4b28a1842dad91433362d250089ec491b8.tar.bz2 re3-21ce0a4b28a1842dad91433362d250089ec491b8.tar.lz re3-21ce0a4b28a1842dad91433362d250089ec491b8.tar.xz re3-21ce0a4b28a1842dad91433362d250089ec491b8.tar.zst re3-21ce0a4b28a1842dad91433362d250089ec491b8.zip |
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/Matrix.h | 14 | ||||
-rw-r--r-- | src/math/math.cpp | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h index 1d26cc20..90f66d7a 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -130,13 +130,18 @@ public: { 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; } + void Scale(float sx, float sy, float sz) + { + float *pFloatMatrix = (float*)&m_matrix; + for (int i = 0; i < 3; i++){ + pFloatMatrix[i * 4 + 0] *= sx; + pFloatMatrix[i * 4 + 1] *= sy; + pFloatMatrix[i * 4 + 2] *= sz; + } + } void SetRotateXOnly(float angle){ @@ -224,6 +229,7 @@ public: void SetRotate(float xAngle, float yAngle, float zAngle); void Rotate(float x, float y, float z); void RotateX(float x); + void RotateY(float y); void RotateZ(float z); void Reorthogonalise(void); diff --git a/src/math/math.cpp b/src/math/math.cpp index e11d048c..e8b459ae 100644 --- a/src/math/math.cpp +++ b/src/math/math.cpp @@ -47,6 +47,12 @@ CMatrix::RotateX(float x) } void +CMatrix::RotateY(float y) +{ + Rotate(0.0f, y, 0.0f); +} + +void CMatrix::RotateZ(float z) { Rotate(0.0f, 0.0f, z); |