aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-15 21:26:17 -0400
committerPaul Gilbert2017-08-15 21:26:17 -0400
commit867a37618b95a1cadeb3a0adf84a4cee31d52699 (patch)
tree36135d560be26248b916cdc463aaa4616f971c57 /engines/titanic/star_control
parent736407d7daca9594ff9049023076991bf4cee014 (diff)
downloadscummvm-rg350-867a37618b95a1cadeb3a0adf84a4cee31d52699.tar.gz
scummvm-rg350-867a37618b95a1cadeb3a0adf84a4cee31d52699.tar.bz2
scummvm-rg350-867a37618b95a1cadeb3a0adf84a4cee31d52699.zip
TITANIC: Further cleanup of FMatrix refactorings
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r--engines/titanic/star_control/fmatrix.cpp40
-rw-r--r--engines/titanic/star_control/fmatrix.h24
2 files changed, 32 insertions, 32 deletions
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp
index 724b5975d4..cd59c559ca 100644
--- a/engines/titanic/star_control/fmatrix.cpp
+++ b/engines/titanic/star_control/fmatrix.cpp
@@ -25,20 +25,21 @@
namespace Titanic {
-//Non-member functions
+// Non-member functions
+
void matProd(const FMatrix &a, const FMatrix &m, FMatrix &C) {
- C._row1._x = a._row1._y * m._row2._x + a._row1._z * m._row3._x + a._row1._x * m._row1._x;
- C._row1._y = a._row1._x * m._row1._y + m._row2._y * a._row1._y + m._row3._y * a._row1._z;
- C._row1._z = a._row1._x * m._row1._z + a._row1._y * m._row2._z + a._row1._z * m._row3._z;
- C._row2._x = m._row1._x * a._row2._x + m._row3._x * a._row2._z + m._row2._x * a._row2._y;
- C._row2._y = m._row3._y * a._row2._z + m._row1._y * a._row2._x + m._row2._y * a._row2._y;
- C._row2._z = a._row2._z * m._row3._z + a._row2._x * m._row1._z + a._row2._y * m._row2._z;
- C._row3._x = m._row1._x * a._row3._x + a._row3._z * m._row3._x + a._row3._y * m._row2._x;
- C._row3._y = a._row3._y * m._row2._y + a._row3._z * m._row3._y + a._row3._x * m._row1._y;
- C._row3._z = a._row3._x * m._row1._z + a._row3._y * m._row2._z + a._row3._z * m._row3._z;
+ C._row1._x = a._row1._y * m._row2._x + a._row1._z * m._row3._x + a._row1._x * m._row1._x;
+ C._row1._y = a._row1._x * m._row1._y + m._row2._y * a._row1._y + m._row3._y * a._row1._z;
+ C._row1._z = a._row1._x * m._row1._z + a._row1._y * m._row2._z + a._row1._z * m._row3._z;
+ C._row2._x = m._row1._x * a._row2._x + m._row3._x * a._row2._z + m._row2._x * a._row2._y;
+ C._row2._y = m._row3._y * a._row2._z + m._row1._y * a._row2._x + m._row2._y * a._row2._y;
+ C._row2._z = a._row2._z * m._row3._z + a._row2._x * m._row1._z + a._row2._y * m._row2._z;
+ C._row3._x = m._row1._x * a._row3._x + a._row3._z * m._row3._x + a._row3._y * m._row2._x;
+ C._row3._y = a._row3._y * m._row2._y + a._row3._z * m._row3._y + a._row3._x * m._row1._y;
+ C._row3._z = a._row3._x * m._row1._z + a._row3._y * m._row2._z + a._row3._z * m._row3._z;
}
-//member functions
+// member functions
FMatrix::FMatrix() :
_row1(1.0, 0.0, 0.0), _row2(0.0, 1.0, 0.0), _row3(0.0, 0.0, 1.0) {
@@ -108,7 +109,6 @@ void FMatrix::set(const FMatrix &m) {
_row3 = m._row3;
}
-
void FMatrix::set(const FVector &row1, const FVector &row2, const FVector &row3) {
_row1 = row1;
_row2 = row2;
@@ -133,17 +133,17 @@ void FMatrix::set(const FVector &v) {
}
void FMatrix::matRProd(const FMatrix &m) {
- FMatrix C = FMatrix();
- FMatrix A = FMatrix(_row1,_row2,_row3);
- matProd(A,m,C);
- this->set(C);
+ FMatrix C = FMatrix();
+ FMatrix A = FMatrix(_row1, _row2, _row3);
+ matProd(A, m, C);
+ this->set(C);
}
void FMatrix::matLProd(const FMatrix &m) {
- FMatrix C = FMatrix();
- FMatrix A = FMatrix(_row1,_row2,_row3);
- matProd(m,A,C);
- this->set(C);
+ FMatrix C = FMatrix();
+ FMatrix A = FMatrix(_row1, _row2, _row3);
+ matProd(m, A, C);
+ this->set(C);
}
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h
index f477500bad..00054ee7bb 100644
--- a/engines/titanic/star_control/fmatrix.h
+++ b/engines/titanic/star_control/fmatrix.h
@@ -91,16 +91,16 @@ public:
*/
void set(const FVector &v);
- /**
- * Changes this matrix, A, to be C, where C=Am. Matrix m multiplies this matrix (A) on its Right.
- * m is said to premultiply A (the previous this matrix).
- */
+ /**
+ * Changes this matrix, A, to be C, where C=Am. Matrix m multiplies this matrix (A) on its Right.
+ * m is said to premultiply A (the previous this matrix).
+ */
void matRProd(const FMatrix &m);
- /**
- * Changes this matrix, A, to be C, where C=mA. Matrix m multiplies this matrix (A) on its Left.
- * m is said to postmultiply A (the previous this matrix).
- */
+ /**
+ * Changes this matrix, A, to be C, where C=mA. Matrix m multiplies this matrix (A) on its Left.
+ * m is said to postmultiply A (the previous this matrix).
+ */
void matLProd(const FMatrix &m);
/**
@@ -128,10 +128,10 @@ public:
};
/**
-* Puts the matrix product between a and m in C, C = am
-* Called by MatLProd and MatLProd
-* Caller must preallocate output matrix
-*/
+ * Puts the matrix product between a and m in C, C = am
+ * Called by MatLProd and MatLProd
+ * Caller must preallocate output matrix
+ */
void matProd(const FMatrix &a, const FMatrix &m, FMatrix &C);
} // End of namespace Titanic