[Scummvm-git-logs] scummvm master -> 867a37618b95a1cadeb3a0adf84a4cee31d52699
dreammaster
dreammaster at scummvm.org
Wed Aug 16 03:26:22 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
867a37618b TITANIC: Further cleanup of FMatrix refactorings
Commit: 867a37618b95a1cadeb3a0adf84a4cee31d52699
https://github.com/scummvm/scummvm/commit/867a37618b95a1cadeb3a0adf84a4cee31d52699
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-15T21:26:17-04:00
Commit Message:
TITANIC: Further cleanup of FMatrix refactorings
Changed paths:
engines/titanic/star_control/fmatrix.cpp
engines/titanic/star_control/fmatrix.h
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp
index 724b597..cd59c55 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 f477500..00054ee 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
More information about the Scummvm-git-logs
mailing list