diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-07-10 14:56:56 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-07-10 14:56:56 +0200 |
commit | 2ef5e4cd662d642b839a9e65b3176335c6b50448 (patch) | |
tree | 5e0a6dcdbf8f1566974c0514986ab7b61e5c067a /src/math | |
parent | Phone start, ped spinning and cop car fix, and some love to CPed (diff) | |
parent | fixed COMMAND_IS_PLAYER_IN_AREA_3D (diff) | |
download | re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.gz re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.bz2 re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.lz re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.xz re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.zst re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.zip |
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/Matrix.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h index eda75e4a..b7d6c207 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -82,6 +82,32 @@ public: CVector &GetRight(void) { return *(CVector*)&m_matrix.right; } CVector &GetForward(void) { return *(CVector*)&m_matrix.up; } CVector &GetUp(void) { return *(CVector*)&m_matrix.at; } + + void SetTranslate(float x, float y, float z){ + m_matrix.right.x = 1.0f; + m_matrix.right.y = 0.0f; + m_matrix.right.z = 0.0f; + + m_matrix.up.x = 0.0f; + m_matrix.up.y = 1.0f; + m_matrix.up.z = 0.0f; + + m_matrix.at.x = 0.0f; + m_matrix.at.y = 0.0f; + m_matrix.at.z = 1.0f; + + m_matrix.pos.x = x; + m_matrix.pos.y = y; + m_matrix.pos.z = z; + } + void SetTranslate(const CVector &trans){ SetTranslate(trans.x, trans.y, trans.z); } + void Translate(float x, float y, float z){ + m_matrix.pos.x += x; + m_matrix.pos.y += y; + m_matrix.pos.z += z; + } + void Translate(const CVector &trans){ Translate(trans.x, trans.y, trans.z); } + void SetScale(float s){ m_matrix.right.x = s; m_matrix.right.y = 0.0f; @@ -99,6 +125,7 @@ public: m_matrix.pos.y = 0.0f; m_matrix.pos.z = 0.0f; } + void SetRotateXOnly(float angle){ float c = cos(angle); float s = sin(angle); |