diff options
author | Sergeanur <s.anureev@yandex.ua> | 2019-10-03 21:28:56 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2019-10-03 21:37:13 +0200 |
commit | 72e12f6aae10e294c9265dd58c75db5c5c54bd24 (patch) | |
tree | 12444f855de79b35585a712d3137ed15d7b73096 /src/math | |
parent | Merge pull request #219 from Sergeanur/MoneyMessages (diff) | |
download | re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.tar re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.tar.gz re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.tar.bz2 re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.tar.lz re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.tar.xz re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.tar.zst re3-72e12f6aae10e294c9265dd58c75db5c5c54bd24.zip |
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/Matrix.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h index 5a3473ad..5145f0ac 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -204,6 +204,22 @@ public: m_matrix.at.y = 0.0f; m_matrix.at.z = 1.0f; } + void SetRotateZOnlyScaled(float angle, float scale) { + float c = Cos(angle); + float s = Sin(angle); + + m_matrix.right.x = c * scale; + m_matrix.right.y = s * scale; + m_matrix.right.z = 0.0f; + + m_matrix.up.x = -s * scale; + m_matrix.up.y = c * scale; + m_matrix.up.z = 0.0f; + + m_matrix.at.x = 0.0f; + m_matrix.at.y = 0.0f; + m_matrix.at.z = scale; + } void SetRotateZ(float angle){ SetRotateZOnly(angle); m_matrix.pos.x = 0.0f; |