From 91093305d65305722e380c0087c71469363a8396 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 18 Jan 2021 21:06:59 +0200 Subject: Get rid of RwMatrix in CMatrix --- src/math/Vector.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/math/Vector.cpp') diff --git a/src/math/Vector.cpp b/src/math/Vector.cpp index 42e1828e..3bc395d8 100644 --- a/src/math/Vector.cpp +++ b/src/math/Vector.cpp @@ -23,24 +23,24 @@ CVector Multiply3x3(const CMatrix &mat, const CVector &vec) { // TODO: VU0 code - return CVector(mat.m_matrix.right.x * vec.x + mat.m_matrix.up.x * vec.y + mat.m_matrix.at.x * vec.z, - mat.m_matrix.right.y * vec.x + mat.m_matrix.up.y * vec.y + mat.m_matrix.at.y * vec.z, - mat.m_matrix.right.z * vec.x + mat.m_matrix.up.z * vec.y + mat.m_matrix.at.z * vec.z); + return CVector(mat.right.x * vec.x + mat.forward.x * vec.y + mat.up.x * vec.z, + mat.right.y * vec.x + mat.forward.y * vec.y + mat.up.y * vec.z, + mat.right.z * vec.x + mat.forward.z * vec.y + mat.up.z * vec.z); } CVector Multiply3x3(const CVector &vec, const CMatrix &mat) { - return CVector(mat.m_matrix.right.x * vec.x + mat.m_matrix.right.y * vec.y + mat.m_matrix.right.z * vec.z, - mat.m_matrix.up.x * vec.x + mat.m_matrix.up.y * vec.y + mat.m_matrix.up.z * vec.z, - mat.m_matrix.at.x * vec.x + mat.m_matrix.at.y * vec.y + mat.m_matrix.at.z * vec.z); + return CVector(mat.right.x * vec.x + mat.right.y * vec.y + mat.right.z * vec.z, + mat.forward.x * vec.x + mat.forward.y * vec.y + mat.forward.z * vec.z, + mat.up.x * vec.x + mat.up.y * vec.y + mat.up.z * vec.z); } CVector operator*(const CMatrix &mat, const CVector &vec) { // TODO: VU0 code - return CVector(mat.m_matrix.right.x * vec.x + mat.m_matrix.up.x * vec.y + mat.m_matrix.at.x * vec.z + mat.m_matrix.pos.x, - mat.m_matrix.right.y * vec.x + mat.m_matrix.up.y * vec.y + mat.m_matrix.at.y * vec.z + mat.m_matrix.pos.y, - mat.m_matrix.right.z * vec.x + mat.m_matrix.up.z * vec.y + mat.m_matrix.at.z * vec.z + mat.m_matrix.pos.z); + return CVector(mat.right.x * vec.x + mat.forward.x * vec.y + mat.up.x * vec.z + mat.pos.x, + mat.right.y * vec.x + mat.forward.y * vec.y + mat.up.y * vec.z + mat.pos.y, + mat.right.z * vec.x + mat.forward.z * vec.y + mat.up.z * vec.z + mat.pos.z); } -- cgit v1.2.3 From e6ef1644418401e5ace5a12537d6bd500db7f0e2 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 19 Jan 2021 17:09:06 +0200 Subject: Get rid of VuVector --- src/math/Vector.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/math/Vector.cpp') diff --git a/src/math/Vector.cpp b/src/math/Vector.cpp index 3bc395d8..ee76e555 100644 --- a/src/math/Vector.cpp +++ b/src/math/Vector.cpp @@ -23,24 +23,24 @@ CVector Multiply3x3(const CMatrix &mat, const CVector &vec) { // TODO: VU0 code - return CVector(mat.right.x * vec.x + mat.forward.x * vec.y + mat.up.x * vec.z, - mat.right.y * vec.x + mat.forward.y * vec.y + mat.up.y * vec.z, - mat.right.z * vec.x + mat.forward.z * vec.y + mat.up.z * vec.z); + return CVector(mat.rx * vec.x + mat.fx * vec.y + mat.ux * vec.z, + mat.ry * vec.x + mat.fy * vec.y + mat.uy * vec.z, + mat.rz * vec.x + mat.fz * vec.y + mat.uz * vec.z); } CVector Multiply3x3(const CVector &vec, const CMatrix &mat) { - return CVector(mat.right.x * vec.x + mat.right.y * vec.y + mat.right.z * vec.z, - mat.forward.x * vec.x + mat.forward.y * vec.y + mat.forward.z * vec.z, - mat.up.x * vec.x + mat.up.y * vec.y + mat.up.z * vec.z); + return CVector(mat.rx * vec.x + mat.ry * vec.y + mat.rz * vec.z, + mat.fx * vec.x + mat.fy * vec.y + mat.fz * vec.z, + mat.ux * vec.x + mat.uy * vec.y + mat.uz * vec.z); } CVector operator*(const CMatrix &mat, const CVector &vec) { // TODO: VU0 code - return CVector(mat.right.x * vec.x + mat.forward.x * vec.y + mat.up.x * vec.z + mat.pos.x, - mat.right.y * vec.x + mat.forward.y * vec.y + mat.up.y * vec.z + mat.pos.y, - mat.right.z * vec.x + mat.forward.z * vec.y + mat.up.z * vec.z + mat.pos.z); + return CVector(mat.rx * vec.x + mat.fx * vec.y + mat.ux * vec.z + mat.px, + mat.ry * vec.x + mat.fy * vec.y + mat.uy * vec.z + mat.py, + mat.rz * vec.x + mat.fz * vec.y + mat.uz * vec.z + mat.pz); } -- cgit v1.2.3