From 9b5392d3a13e00d880e895522c19ef1e453804b0 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 29 Jun 2019 14:38:37 +0300 Subject: ProcessPedUpdate --- src/math/Matrix.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/math/Matrix.h') 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; } -- cgit v1.2.3 From ad76379eba3084c15183baaa4cd39192e9a2be7c Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 29 Jun 2019 18:01:43 +0300 Subject: more replay stuff, bug fix --- src/math/Matrix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math/Matrix.h') diff --git a/src/math/Matrix.h b/src/math/Matrix.h index bbdc6a70..63cb2753 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -74,7 +74,7 @@ public: 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; + m_matrix.pos.z += rhs.m_matrix.pos.z; return *this; } -- cgit v1.2.3 From e2bd3573b4d44b8f80197d8de98fcfc91e2229b8 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 30 Jun 2019 13:59:55 +0300 Subject: PlayBackThisFrameInterpolation and all it required... --- src/math/Matrix.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/math/Matrix.h') diff --git a/src/math/Matrix.h b/src/math/Matrix.h index 63cb2753..6e1001cb 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -202,6 +202,21 @@ public: void CopyOnlyMatrix(CMatrix *other){ m_matrix = other->m_matrix; } + void SetUnity(void) { + 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 = 0.0f; + m_matrix.pos.x = 0.0f; + m_matrix.pos.y = 0.0f; + m_matrix.pos.z = 0.0f; + } }; inline CMatrix& -- cgit v1.2.3