diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-06-29 13:38:37 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-06-29 13:38:37 +0200 |
commit | 9b5392d3a13e00d880e895522c19ef1e453804b0 (patch) | |
tree | 9c807c08baa487aa9c65d06489ef363ddf8491ff /src/math | |
parent | Changed to actual crimes names (diff) | |
download | re3-9b5392d3a13e00d880e895522c19ef1e453804b0.tar re3-9b5392d3a13e00d880e895522c19ef1e453804b0.tar.gz re3-9b5392d3a13e00d880e895522c19ef1e453804b0.tar.bz2 re3-9b5392d3a13e00d880e895522c19ef1e453804b0.tar.lz re3-9b5392d3a13e00d880e895522c19ef1e453804b0.tar.xz re3-9b5392d3a13e00d880e895522c19ef1e453804b0.tar.zst re3-9b5392d3a13e00d880e895522c19ef1e453804b0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/math/Matrix.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h index e2e5394e..bbdc6a70 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -20,6 +20,11 @@ public: m_attachment = nil; Attach(matrix, owner); } + CMatrix(float scale){ + m_attachment = nil; + m_hasRwMatrix = false; + SetScale(scale); + } ~CMatrix(void){ if(m_hasRwMatrix && m_attachment) RwMatrixDestroy(m_attachment); @@ -57,6 +62,21 @@ public: if(m_attachment) UpdateRW(); } + CMatrix& operator+=(CMatrix const &rhs){ + m_matrix.right.x += rhs.m_matrix.right.x; + m_matrix.up.x += rhs.m_matrix.up.x; + m_matrix.at.x += rhs.m_matrix.at.x; + m_matrix.right.y += rhs.m_matrix.right.y; + m_matrix.up.y += rhs.m_matrix.up.y; + m_matrix.at.y += rhs.m_matrix.at.y; + m_matrix.right.z += rhs.m_matrix.right.z; + m_matrix.up.z += rhs.m_matrix.up.z; + m_matrix.at.z += rhs.m_matrix.at.z; + m_matrix.pos.x += rhs.m_matrix.pos.x; + m_matrix.pos.y += rhs.m_matrix.pos.y; + m_matrix.pos.y += rhs.m_matrix.pos.z; + return *this; + } CVector *GetPosition(void){ return (CVector*)&m_matrix.pos; } CVector *GetRight(void) { return (CVector*)&m_matrix.right; } |