summaryrefslogtreecommitdiffstats
path: root/src/math/Vector.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-20 17:59:33 +0100
committerGitHub <noreply@github.com>2021-01-20 17:59:33 +0100
commit9b193a47a22d99ac89a4bec584d40ae41f971286 (patch)
treebadff7d74ddadf1de18aeb7473cdfc05a175da72 /src/math/Vector.cpp
parentMerge branch 'master' of github.com:GTAmodding/re3 (diff)
parentGet rid of VuVector (diff)
downloadre3-9b193a47a22d99ac89a4bec584d40ae41f971286.tar
re3-9b193a47a22d99ac89a4bec584d40ae41f971286.tar.gz
re3-9b193a47a22d99ac89a4bec584d40ae41f971286.tar.bz2
re3-9b193a47a22d99ac89a4bec584d40ae41f971286.tar.lz
re3-9b193a47a22d99ac89a4bec584d40ae41f971286.tar.xz
re3-9b193a47a22d99ac89a4bec584d40ae41f971286.tar.zst
re3-9b193a47a22d99ac89a4bec584d40ae41f971286.zip
Diffstat (limited to 'src/math/Vector.cpp')
-rw-r--r--src/math/Vector.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/math/Vector.cpp b/src/math/Vector.cpp
index 42e1828e..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.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.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.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.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.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.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);
}